-
Notifications
You must be signed in to change notification settings - Fork 12
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
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
.
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.