summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsensfel <SpamShield0@noot-noot.org>2018-02-28 17:46:41 +0100
committernsensfel <SpamShield0@noot-noot.org>2018-02-28 17:46:41 +0100
commit1b59bdfc0d923a1ebfcebf4d6efceb2f2f4579a4 (patch)
treed000a796fd61b27d8031cbdf691f1be73fdb5cb0 /src/struct/weapon.erl
parent5235345620c0d4a6669ccc6badc387902ea8c92a (diff)
Moved the mess from 'character_turn' into 'attack'.
Diffstat (limited to 'src/struct/weapon.erl')
-rw-r--r--src/struct/weapon.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/struct/weapon.erl b/src/struct/weapon.erl
index d96886c..80cb925 100644
--- a/src/struct/weapon.erl
+++ b/src/struct/weapon.erl
@@ -55,6 +55,7 @@
[
random_id/0,
from_id/1,
+ can_parry/1,
apply_to_attributes/2
]
).
@@ -102,6 +103,9 @@ get_ranges (Wp) ->
get_damages (Wp) ->
damages_of_type(Wp#weapon.range_type, Wp#weapon.damage_mod).
+-spec can_parry (struct()) -> boolean().
+can_parry (Wp) -> (Wp#weapon.range_type == melee).
+
-spec from_id (id()) -> struct().
from_id (0) ->
#weapon{