summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-10-09 19:34:02 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-10-09 19:34:02 +0200
commit169d7ff927917f2b0bf4cc6349a483f1031960fc (patch)
tree30b1a9624c5f0f0f7ca67ebccf19dde3a3cd19b7 /src/shared
parent80cf57bc91d25a043ed8c1de557ebe1ccbe17022 (diff)
(Broken) glyphs lists, not arrays...
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/struct/shr_armor.erl.m46
-rw-r--r--src/shared/struct/shr_glyph_board.erl.m46
-rw-r--r--src/shared/struct/shr_portrait.erl.m48
-rw-r--r--src/shared/struct/shr_weapon.erl.m46
4 files changed, 21 insertions, 5 deletions
diff --git a/src/shared/struct/shr_armor.erl.m4 b/src/shared/struct/shr_armor.erl.m4
index 01d810a..a72331a 100644
--- a/src/shared/struct/shr_armor.erl.m4
+++ b/src/shared/struct/shr_armor.erl.m4
@@ -36,6 +36,7 @@
(
[
random_id/0,
+ none/0,
from_id/1
]
).
@@ -62,7 +63,10 @@ get_omnimods (Ar) -> Ar#armor.omnimods.
m4_include(__MAKEFILE_DATA_DIR/armor/global.m4.conf)m4_dnl
m4_include(__MAKEFILE_DATA_DIR/armor/basic.m4d)m4_dnl
from_id(_) ->
- from_id(0).
+ none().
+
+-spec none () -> type().
+none () -> from_id(0).
-spec random_id () -> id().
random_id () -> shr_roll:between(0, 4).
diff --git a/src/shared/struct/shr_glyph_board.erl.m4 b/src/shared/struct/shr_glyph_board.erl.m4
index 1631441..7fe77b1 100644
--- a/src/shared/struct/shr_glyph_board.erl.m4
+++ b/src/shared/struct/shr_glyph_board.erl.m4
@@ -43,6 +43,7 @@
-export
(
[
+ none/0,
get_omnimods_with_glyphs/2
]
).
@@ -90,7 +91,10 @@ get_slots (GlyphBoard) -> GlyphBoard#glyph_board.slots.
m4_include(__MAKEFILE_DATA_DIR/glyph_board/global.m4.conf)m4_dnl
m4_include(__MAKEFILE_DATA_DIR/glyph_board/basic.m4d)m4_dnl
from_id(_) ->
- from_id(<<"0">>).
+ none().
+
+-spec none () -> type().
+none () -> from_id(<<"0">>).
-spec get_omnimods_with_glyphs
(
diff --git a/src/shared/struct/shr_portrait.erl.m4 b/src/shared/struct/shr_portrait.erl.m4
index e009527..fefc434 100644
--- a/src/shared/struct/shr_portrait.erl.m4
+++ b/src/shared/struct/shr_portrait.erl.m4
@@ -37,7 +37,8 @@
-export
(
[
- from_id/1
+ from_id/1,
+ default/0
]
).
@@ -66,4 +67,7 @@ get_icon_id (Pt) -> Pt#portrait.icon_id.
m4_include(__MAKEFILE_DATA_DIR/portrait/global.m4.conf)m4_dnl
m4_include(__MAKEFILE_DATA_DIR/portrait/basic.m4d)m4_dnl
from_id(_) ->
- from_id(<<"cat">>).
+ default().
+
+-spec default () -> type().
+default () -> from_id(<<"cat">>).
diff --git a/src/shared/struct/shr_weapon.erl.m4 b/src/shared/struct/shr_weapon.erl.m4
index 55c2815..ccda881 100644
--- a/src/shared/struct/shr_weapon.erl.m4
+++ b/src/shared/struct/shr_weapon.erl.m4
@@ -40,6 +40,7 @@
(
[
random_id/0,
+ none/0,
from_id/1
]
).
@@ -71,7 +72,10 @@ get_omnimods (Wp) -> Wp#weapon.omnimods.
m4_include(__MAKEFILE_DATA_DIR/weapon/global.m4.conf)m4_dnl
m4_include(__MAKEFILE_DATA_DIR/weapon/basic.m4d)m4_dnl
from_id (_) ->
- from_id(0).
+ none().
+
+-spec none () -> type().
+none () -> from_id(0).
-spec random_id () -> id().
random_id () -> shr_roll:between(0, 24).