summaryrefslogtreecommitdiff
path: root/priv_entries.h
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-09 18:31:29 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-09 18:39:01 +0100
commit2a76d0662f9494f8469283a7b0fc72c17f40ecf6 (patch)
tree8420a57e6029a5d62a31343a13b51acbeb3e7d60 /priv_entries.h
parentdfe9604dc9e4292c9f0e420d3a926e8268178308 (diff)
implement a way to define who is targetable by an action
we can specify who are the targets of an action by setting the field entry->action.target it can be a combination of one or more specifiers, such as: one team an eneny self everyone Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'priv_entries.h')
-rw-r--r--priv_entries.h140
1 files changed, 100 insertions, 40 deletions
diff --git a/priv_entries.h b/priv_entries.h
index 62fe5f2..dd6ff69 100644
--- a/priv_entries.h
+++ b/priv_entries.h
@@ -10,13 +10,19 @@ struct entry_t white_magic_entries[] = {
{
.name = "Cure",
.children_cnt = 0,
- .f = cast_cure,
- .data = NULL,
+ .action = {
+ .f = cast_cure,
+ .data = NULL,
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Cure +",
.children_cnt = 0,
- .f = cast_cure,
- .data = NULL,
+ .action = {
+ .f = cast_cure,
+ .data = NULL,
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ }
},
};
@@ -24,68 +30,107 @@ struct entry_t black_magic_entries[] = {
{
.name = "Fire",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_FIRE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_FIRE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Fire +",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_FIRE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_FIRE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Fire x",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_FIRE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_FIRE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Ice -",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_ICE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_ICE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Ice +",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_ICE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_ICE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Ice x",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_ICE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_ICE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Thunder",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_THUNDER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_THUNDER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Thunder +",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_THUNDER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_THUNDER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Thunder x",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_THUNDER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_THUNDER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Water",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_WATER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_WATER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Water + ",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_WATER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_WATER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Water x",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_WATER },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_WATER },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
}, {
.name = "Choc",
.children_cnt = 0,
- .f = cast_element,
- .data = (enum element_t []) { ELEMENT_NONE },
+ .action = {
+ .f = cast_element,
+ .data = (enum element_t []) { ELEMENT_NONE },
+ .target = TARGET_SINGLE | TARGET_TEAM,
+ },
},
};
@@ -93,23 +138,35 @@ struct entry_t object_entries[] = {
{
.name = "Potion",
.children_cnt = 0,
- .f = use_potion,
- .data = (int []) { POTION },
+ .action = {
+ .f = use_potion,
+ .data = (int []) { POTION },
+ .target = TARGET_SINGLE,
+ },
}, {
.name = "Potion +",
.children_cnt = 0,
- .f = use_potion,
- .data = (int []) { POTIONPLUS },
+ .action = {
+ .f = use_potion,
+ .data = (int []) { POTIONPLUS },
+ .target = TARGET_SINGLE,
+ },
}, {
.name = "Ether",
.children_cnt = 0,
- .f = use_ether,
- .data = (int []) { ETHER },
+ .action = {
+ .f = use_ether,
+ .data = (int []) { ETHER },
+ .target = TARGET_SINGLE,
+ },
}, {
.name = "Ether + ",
.children_cnt = 0,
- .f = use_ether,
- .data = (int []) { ETHERPLUS },
+ .action = {
+ .f = use_ether,
+ .data = (int []) { ETHERPLUS },
+ .target = TARGET_SINGLE,
+ },
},
};
@@ -117,8 +174,11 @@ struct entry_t action_entries_g[] = {
{
.name = "Attack",
.children_cnt = 0,
- .f = attack,
- .data = NULL,
+ .action = {
+ .f = attack,
+ .data = NULL,
+ .target = TARGET_SINGLE,
+ },
}, {
.name = "White Magic",
.children = white_magic_entries,