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

Oreon training #9

Merged
merged 6 commits into from Jun 9, 2018
Merged

Conversation

Naman-sopho
Copy link
Member

@Naman-sopho Naman-sopho commented Jun 4, 2018

  • Add Oreon training for Intelligence and Strength attributes.
  • Add buildings Gym and Classroom for this training. Each time the Oreon visits one of these buildings its corresponding attribute is increased by 10.
  • Add a DelayedNotificationSystem so that the player is not notified of a missing building every time the Oreon's BT is run.
  • Add WorldlyTooltip which currently displays all Oreon Attributes with a placeholder icon image.

Outstanding before merge:

  • Oreon's attribute is increased beyond the maximum limit when the difference between the max value and current value is less than 10.

@Naman-sopho Naman-sopho added this to In Progress in GSOC 2018 - Master of Oreon Jun 4, 2018
@@ -0,0 +1,50 @@
/*
* Copyright 2017 MovingBlocks
Copy link
Contributor

Choose a reason for hiding this comment

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

2018

@@ -0,0 +1,102 @@
/*
* Copyright 2017 MovingBlocks
Copy link
Contributor

Choose a reason for hiding this comment

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

2018

@@ -96,6 +96,20 @@ private void changeOreonAttributes(Actor oreon, TaskComponent taskComponent) {
oreonAttributeComponent.hunger = 0;
break;

case AssignedTaskType.Train_Strength:
oreonAttributeComponent.strength += 10;
oreonAttributeComponent.strength = oreonAttributeComponent.strength > oreonAttributeComponent.maxStrength
Copy link
Contributor

Choose a reason for hiding this comment

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

Assigning the same value doesn't make sense. Just use an if ( str > max) { str = max; } statement.


case AssignedTaskType.Train_Intelligence:
oreonAttributeComponent.intelligence += 10;
oreonAttributeComponent.intelligence = oreonAttributeComponent.intelligence > oreonAttributeComponent.maxIntelligence
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above. use an if statement instead.

@@ -0,0 +1,58 @@
/*
* Copyright 2017 MovingBlocks
Copy link
Contributor

Choose a reason for hiding this comment

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

2018

@ReceiveEvent(components = OreonAttributeComponent.class)
public void addAttributesToTooltip(GetItemTooltip event, EntityRef entity, OreonAttributeComponent oreonAttributeComponent) {
event.getTooltipLines().add(new TooltipLine("Level : " + oreonAttributeComponent.currentLevel));
event.getTooltipLines().add(new TooltipLine("Health : " + oreonAttributeComponent.health + " / " + oreonAttributeComponent.maxStrength ));
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be maxHealth, not maxStr?

@@ -0,0 +1,24 @@
/*
* Copyright 2017 MovingBlocks
Copy link
Contributor

Choose a reason for hiding this comment

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

2018

private long maxDelay = 10;

public float sendNotification(String message, EntityRef notificationMessageEntity, float lastNotification) {
if (time.getGameTime() - lastNotification > maxDelay || lastNotification == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should check for lastNotification == 0 first, then the subtraction > max check.

Copy link
Member

@Cervator Cervator left a comment

Choose a reason for hiding this comment

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

Can't find anything to add on top of existing comments, happy to merge when those are addressed :-)

Tests out well, nice work!

@Cervator Cervator merged commit 16be748 into Terasology:develop Jun 9, 2018
GSOC 2018 - Master of Oreon automation moved this from In Progress to Done Jun 9, 2018
@Cervator
Copy link
Member

Cervator commented Jun 9, 2018

Tweaks applied - merged! :-)

@Naman-sopho Naman-sopho deleted the Oreon-training branch June 10, 2018 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants