diff options
Diffstat (limited to 'src')
18 files changed, 39 insertions, 34 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/BlankEventGraphic.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/BlankEventGraphic.java index 1f317f8..77d383f 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/BlankEventGraphic.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/BlankEventGraphic.java | |||
@@ -9,6 +9,7 @@ import com.fourisland.fourpuzzle.Direction; | |||
9 | import java.awt.image.BufferedImage; | 9 | import java.awt.image.BufferedImage; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * BlankEventGraphic specifies an Event without an image. | ||
12 | * | 13 | * |
13 | * @author hatkirby | 14 | * @author hatkirby |
14 | */ | 15 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/CharSetEventGraphic.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/CharSetEventGraphic.java index a2e8831..6064f24 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/CharSetEventGraphic.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/CharSetEventGraphic.java | |||
@@ -10,6 +10,7 @@ import com.fourisland.fourpuzzle.gamestate.mapview.CharSet; | |||
10 | import java.awt.image.BufferedImage; | 10 | import java.awt.image.BufferedImage; |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * CharSetEventGraphic specifes an Event with an image from a <b>CharSet</b>. | ||
13 | * | 14 | * |
14 | * @author hatkirby | 15 | * @author hatkirby |
15 | */ | 16 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/EventGraphic.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/EventGraphic.java index 7e83dd9..2cf9497 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/EventGraphic.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/graphic/EventGraphic.java | |||
@@ -9,6 +9,7 @@ import com.fourisland.fourpuzzle.Direction; | |||
9 | import java.awt.image.BufferedImage; | 9 | import java.awt.image.BufferedImage; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * An EventGraphic specifies the image to be displayed on the map for an Event. | ||
12 | * | 13 | * |
13 | * @author hatkirby | 14 | * @author hatkirby |
14 | */ | 15 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/CustomMovementType.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/CustomMovementType.java index f8f9719..0002c03 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/CustomMovementType.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/CustomMovementType.java | |||
@@ -8,6 +8,9 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.movement; | |||
8 | import com.fourisland.fourpuzzle.Direction; | 8 | import com.fourisland.fourpuzzle.Direction; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * CustomMovementEvent takes an array of Directions and directions the event | ||
12 | * to move in each of them, one by one, returning to the top of the list when | ||
13 | * done. | ||
11 | * | 14 | * |
12 | * @author hatkirby | 15 | * @author hatkirby |
13 | */ | 16 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/MovementType.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/MovementType.java index 7beba85..f304ec0 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/MovementType.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/MovementType.java | |||
@@ -8,6 +8,10 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.movement; | |||
8 | import com.fourisland.fourpuzzle.Direction; | 8 | import com.fourisland.fourpuzzle.Direction; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * A MovementType is an object that specifies the type of AI a non-hero event | ||
12 | * will have. Every tick when said event is not moving, MovementType's | ||
13 | * <b>nextMovement()</b> function will be invoked which should return the next | ||
14 | * direction for the event to move into. | ||
11 | * | 15 | * |
12 | * @author hatkirby | 16 | * @author hatkirby |
13 | */ | 17 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/RandomMovementType.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/RandomMovementType.java index df93c6f..fd65a41 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/RandomMovementType.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/RandomMovementType.java | |||
@@ -9,6 +9,7 @@ import com.fourisland.fourpuzzle.Direction; | |||
9 | import java.util.Random; | 9 | import java.util.Random; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * RandomMovementType moves the event in random directions. | ||
12 | * | 13 | * |
13 | * @author hatkirby | 14 | * @author hatkirby |
14 | */ | 15 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/StayStillMovementType.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/StayStillMovementType.java index 2526f0f..e373de9 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/StayStillMovementType.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/movement/StayStillMovementType.java | |||
@@ -8,6 +8,7 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.movement; | |||
8 | import com.fourisland.fourpuzzle.Direction; | 8 | import com.fourisland.fourpuzzle.Direction; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * StayStillMovementType keeps the event stationary. | ||
11 | * | 12 | * |
12 | * @author hatkirby | 13 | * @author hatkirby |
13 | */ | 14 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java index 0c0af20..b25562b 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroInPartyPrecondition.java | |||
@@ -8,6 +8,8 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | |||
8 | import com.fourisland.fourpuzzle.Game; | 8 | import com.fourisland.fourpuzzle.Game; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * HeroInPartyPrecondition checks to see if a specific character is in the | ||
12 | * party. | ||
11 | * | 13 | * |
12 | * @author hatkirby | 14 | * @author hatkirby |
13 | */ | 15 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java deleted file mode 100644 index ae8183d..0000000 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/HeroLevelPrecondition.java +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * To change this template, choose Tools | Templates | ||
3 | * and open the template in the editor. | ||
4 | */ | ||
5 | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | ||
7 | |||
8 | import com.fourisland.fourpuzzle.Game; | ||
9 | |||
10 | /** | ||
11 | * | ||
12 | * @author hatkirby | ||
13 | */ | ||
14 | public class HeroLevelPrecondition implements Precondition { | ||
15 | |||
16 | private String heroName; | ||
17 | private int level; | ||
18 | |||
19 | public HeroLevelPrecondition(String heroName, int level) | ||
20 | { | ||
21 | this.heroName = heroName; | ||
22 | this.level = level; | ||
23 | } | ||
24 | |||
25 | public boolean match() | ||
26 | { | ||
27 | return (Game.getSaveFile().getParty().exists(heroName) && (Game.getSaveFile().getParty().get(heroName).getLevel() == level)); | ||
28 | } | ||
29 | |||
30 | } | ||
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java index b275100..46cdcd2 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/Precondition.java | |||
@@ -6,6 +6,12 @@ | |||
6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | 6 | package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * A Precondition is an object that helps <b>LayerEvent</b> to determine which | ||
10 | * of its (possibly many) <b>PossibleEvent</b>s is active. PossibleEvents can | ||
11 | * have Preconditions attached to them and when all Preconditions are fulfilled | ||
12 | * (determined by the <code>true</code> return value from <b>match()</b>) and | ||
13 | * there are not fulfilled PossibleEvents later in the queue, said PossibleEvent | ||
14 | * will be active. | ||
9 | * | 15 | * |
10 | * @author hatkirby | 16 | * @author hatkirby |
11 | */ | 17 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java index 7bccadf..9ea6c16 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/SwitchPrecondition.java | |||
@@ -8,6 +8,7 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.precondition; | |||
8 | import com.fourisland.fourpuzzle.Game; | 8 | import com.fourisland.fourpuzzle.Game; |
9 | 9 | ||
10 | /** | 10 | /** |
11 | * SwitchPrecondition checks to see if a certain Switch is ON. | ||
11 | * | 12 | * |
12 | * @author hatkirby | 13 | * @author hatkirby |
13 | */ | 14 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java index afedadd..ab8d977 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableNumberPrecondition.java | |||
@@ -9,6 +9,8 @@ import com.fourisland.fourpuzzle.util.Comparison; | |||
9 | import com.fourisland.fourpuzzle.Game; | 9 | import com.fourisland.fourpuzzle.Game; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * VariableNumberPrecondition compares a the value of a variable and a number | ||
13 | * together with a specified Comparison. | ||
12 | * | 14 | * |
13 | * @author hatkirby | 15 | * @author hatkirby |
14 | */ | 16 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java index dbdf019..91a31ba 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/precondition/VariableVariablePrecondition.java | |||
@@ -9,6 +9,8 @@ import com.fourisland.fourpuzzle.util.Comparison; | |||
9 | import com.fourisland.fourpuzzle.Game; | 9 | import com.fourisland.fourpuzzle.Game; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * VariableVariablePrecondition compares two variables together with a specified | ||
13 | * Comparison. | ||
12 | * | 14 | * |
13 | * @author hatkirby | 15 | * @author hatkirby |
14 | */ | 16 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/FaceMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/FaceMoveEvent.java index fcc0a7a..3ed545b 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/FaceMoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/FaceMoveEvent.java | |||
@@ -9,7 +9,8 @@ import com.fourisland.fourpuzzle.Direction; | |||
9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; | 9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * | 12 | * FaceMoveEvent turns the selected Event in the chosen direction. |
13 | * | ||
13 | * @author hatkirby | 14 | * @author hatkirby |
14 | */ | 15 | */ |
15 | public class FaceMoveEvent implements MoveEvent { | 16 | public class FaceMoveEvent implements MoveEvent { |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/LoopUntilCollisionMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/LoopUntilCollisionMoveEvent.java index 4c9eb6e..02744d0 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/LoopUntilCollisionMoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/LoopUntilCollisionMoveEvent.java | |||
@@ -9,7 +9,12 @@ import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; | |||
9 | import java.awt.Point; | 9 | import java.awt.Point; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * | 12 | * LoopUntilCollisionMoveEvent takes an array of <b>MoveEvent</b>s and repeatedly |
13 | * executes them until the event in question collides into something. This is | ||
14 | * done by comparing the location of the event before and after the MoveEvents execute. | ||
15 | * Because of this, MoveEvent arrays that do not move the event will not block the | ||
16 | * game. | ||
17 | * | ||
13 | * @author hatkirby | 18 | * @author hatkirby |
14 | */ | 19 | */ |
15 | public class LoopUntilCollisionMoveEvent implements MoveEvent { | 20 | public class LoopUntilCollisionMoveEvent implements MoveEvent { |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEvent.java index 1d64d9e..b79c45a 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/MoveEvent.java | |||
@@ -9,7 +9,9 @@ package com.fourisland.fourpuzzle.gamestate.mapview.event.specialmove; | |||
9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; | 9 | import com.fourisland.fourpuzzle.gamestate.mapview.event.Event; |
10 | 10 | ||
11 | /** | 11 | /** |
12 | * | 12 | * A MoveEvent is an object that tells the <b>MoveEvent()</b> SpecialEvent |
13 | * what to do. | ||
14 | * | ||
13 | * @author hatkirby | 15 | * @author hatkirby |
14 | */ | 16 | */ |
15 | public interface MoveEvent { | 17 | public interface MoveEvent { |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java index 2f55816..d5d830e 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java | |||
@@ -11,6 +11,7 @@ import java.util.logging.Level; | |||
11 | import java.util.logging.Logger; | 11 | import java.util.logging.Logger; |
12 | 12 | ||
13 | /** | 13 | /** |
14 | * StepMoveEvent moves the event in the direction specified. | ||
14 | * | 15 | * |
15 | * @author hatkirby | 16 | * @author hatkirby |
16 | */ | 17 | */ |
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/WaitMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/WaitMoveEvent.java index 1464bcd..eb56b95 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/WaitMoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/WaitMoveEvent.java | |||
@@ -10,7 +10,8 @@ import java.util.logging.Level; | |||
10 | import java.util.logging.Logger; | 10 | import java.util.logging.Logger; |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * | 13 | * WaitMoveEvent pauses for the specifed amount of milliseconds. |
14 | * | ||
14 | * @author hatkirby | 15 | * @author hatkirby |
15 | */ | 16 | */ |
16 | public class WaitMoveEvent implements MoveEvent { | 17 | public class WaitMoveEvent implements MoveEvent { |