Commit ee2dbc00 authored by Mathieu Hilaire's avatar Mathieu Hilaire

trigger gold implemented

parent e0e19cfe
......@@ -333,7 +333,9 @@ FIREBOLT
DEFAULT_TRIGGER
#effect descriptor
1
TRAP_TRIGGER
TRIGGER_GOLD
#abilityList
0
1
TEST_SUICIDE
......@@ -269,6 +269,12 @@ public class EffectBuilder implements Serializable{
}
};
}
/**
* A trigger increasing the amount of gold of the characters in the area. if it happens then send a destroy event
* to the entity responsable.
* @return An instance of Effect doing what is described above.
*/
Effect trigger_gold() {
return new Effect() {
private static final long serialVersionUID = 1L;
......@@ -279,7 +285,7 @@ public class EffectBuilder implements Serializable{
for (Integer targetID : targetCharacterIDList) {
try {
if(gameContent.getGameState().getEntity(casterCharacterID).getOwned_character() != targetID) {
gameContent.getGameState().getCharacter(targetID).takeDamage(Math.max(1, 0));
gameContent.getGameState().getCharacter(targetID).setGold( gameContent.getGameState().getCharacter(targetID).getGold() + 1 );
hit =true;
}
} catch (EntityNotFoundExeption entityNotFoundExeption) {
......
......@@ -94,8 +94,8 @@ public final class Character extends Being {
}
/**
* Returns the character's gold value.
* @return the character's gold value.
* Set the character's gold value.
* @set the character's gold value.
*/
public void setGold( int gold2) {
this.gold = gold2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment