Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make oreon attributes affect task completion time #51

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Make oreon attributes affect task completion time #51

wants to merge 1 commit into from

Conversation

RatMoleRat
Copy link
Contributor

Closes #32

Recommended testing: spawn two oreons and note their strength values (strength is the primary skill for building). After they are both spawned, quickly start two buildings of the same type. The oreon with the higher strength value will finish its task first.

Copy link
Member

@Naman-sopho Naman-sopho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and it works fine. But I think the task completion time calculation logic should be improved.
Edit: Also, you have used Attr in multiple places, I believe simply Attribute would just make the code more readable.

float currentTime = timer.getGameTime();

return currentTime + newTask.taskDuration;
return currentTime + newTask.taskDuration - Math.min(relevantSkill / 2, newTask.taskDuration);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should come up with a better formula. In some cases this might just return the currentTime as task completion time which does not seem right.

@@ -33,6 +33,8 @@ public TrainIntelligenceTask() {
this.strength = STRENGTH;
this.hunger = HUNGER;

this.primaryAttr = STRENGTH_ATTR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be INTELLIGENCE_ATTR

@@ -33,6 +33,8 @@ public TrainStrengthTask() {
this.strength = STRENGTH;
this.hunger = HUNGER;

this.primaryAttr = INTELLIGENCE_ATTR;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be STRENGTH_ATTR.

@skaldarnar skaldarnar marked this pull request as draft April 11, 2020 15:00
@jdrueckert jdrueckert closed this May 21, 2020
@skaldarnar skaldarnar reopened this May 21, 2020
@skaldarnar skaldarnar changed the base branch from master to develop May 21, 2020 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oreon attributes should affect the way they perform a task
4 participants