summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle/mechanic/condition/blt_cond_heal.erl38
-rw-r--r--src/battle/mechanic/skill/blt_skill_attack_anywhere.erl52
-rw-r--r--src/battle/mechanic/skill/blt_skill_shields_up.erl40
-rw-r--r--src/battle/struct/btl_action.erl10
-rw-r--r--src/shared/struct/shr_condition.erl9
5 files changed, 146 insertions, 3 deletions
diff --git a/src/battle/mechanic/condition/blt_cond_heal.erl b/src/battle/mechanic/condition/blt_cond_heal.erl
new file mode 100644
index 0000000..dd7a820
--- /dev/null
+++ b/src/battle/mechanic/condition/blt_cond_heal.erl
@@ -0,0 +1,38 @@
+-module(btl_cond_heal).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-export
+(
+ [
+ apply/2
+ ]
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-spec apply
+ (
+ non_neg_integer(),
+ non_neg_integer(),
+ btl_battle:type()
+ ) ->
+ {
+ btl_condition:type(),
+ [ataxic:basic()],
+ btl_character:type(),
+ [ataxic:basic()]
+ }.
+apply (Condition, Character) ->
+ % TODO
+ {Condition, [], Character, []}.
+
diff --git a/src/battle/mechanic/skill/blt_skill_attack_anywhere.erl b/src/battle/mechanic/skill/blt_skill_attack_anywhere.erl
new file mode 100644
index 0000000..bcc8519
--- /dev/null
+++ b/src/battle/mechanic/skill/blt_skill_attack_anywhere.erl
@@ -0,0 +1,52 @@
+-module(btl_skill_attack_anywhere).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-export
+(
+ [
+ cast/5
+ ]
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-spec cast
+ (
+ shr_skill:variant(),
+ non_neg_integer(),
+ list(non_neg_integer()),
+ list(shr_location:type()),
+ btl_character_turn_update:type()
+ ) -> btl_character_turn_update:type().
+cast (_Variant, UserIX, TargetIXs, _Locations, Update) ->
+ TargetIX =
+ case TargetIXs of
+ [ValTargetIX] -> ValTargetIX;
+ _ -> error({skill, target, TargetIXs})
+ end,
+
+ % TODO: Add condition to Character[UserIX]:
+ % {
+ % Effect: Attack Range Increase
+ % Trigger: Start of Own Attack
+ % Duration: -1 (Infinite)
+ % Uses: 1
+ % Parameter: Max Value.
+
+ % TODO: Add cast event to Update.
+
+ btl_actions_management:handle
+ (
+ [btl_action:new_attack(UserIX, TargetIX)],
+ Update
+ ).
diff --git a/src/battle/mechanic/skill/blt_skill_shields_up.erl b/src/battle/mechanic/skill/blt_skill_shields_up.erl
new file mode 100644
index 0000000..32af8c2
--- /dev/null
+++ b/src/battle/mechanic/skill/blt_skill_shields_up.erl
@@ -0,0 +1,40 @@
+-module(btl_skill_shields_up).
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% TYPES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-include("tacticians/skills.hrl")
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-export
+(
+ [
+ cast/5
+ ]
+).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-spec cast
+ (
+ shr_skill:variant(),
+ non_neg_integer(),
+ list(non_neg_integer()),
+ list(shr_location:type()),
+ btl_character_turn_update:type()
+ ) -> btl_character_turn_update:type().
+cast (Variant, _UserIX, TargetIXs, _Locations, Update) ->
+ % TODO: Add condition to TargetIXs:
+ % {
+ % Effect: Defense Percentage Increase
+ % Trigger: Start of Own Attack, Start of Target Attack
+ % Duration: {Beta} Turns
+ % Uses: -1 (Infinite)
+ % Parameter: {Alpha}.
+ Update.
diff --git a/src/battle/struct/btl_action.erl b/src/battle/struct/btl_action.erl
index 11b2d06..4940456 100644
--- a/src/battle/struct/btl_action.erl
+++ b/src/battle/struct/btl_action.erl
@@ -66,6 +66,7 @@
(
[
new_move/3,
+ new_attack/2,
new_attack_of_opportunity/2
]
).
@@ -202,6 +203,15 @@ new_attack_of_opportunity (ActorIX, TargetIX) ->
is_opportunistic = true
}.
+-spec new_attack (non_neg_integer(), non_neg_integer()) -> type().
+new_attack (ActorIX, TargetIX) ->
+ #attack
+ {
+ actor_ix = ActorIX,
+ target_ix = TargetIX,
+ is_opportunistic = false
+ }.
+
-spec get_category (type()) -> category().
get_category (Action) when is_record(Action, attack) -> attack;
get_category (Action) when is_record(Action, move) -> move;
diff --git a/src/shared/struct/shr_condition.erl b/src/shared/struct/shr_condition.erl
index 5b6f0e9..ec2493a 100644
--- a/src/shared/struct/shr_condition.erl
+++ b/src/shared/struct/shr_condition.erl
@@ -13,8 +13,7 @@
id :: id(),
name :: binary(),
description :: binary(),
- triggers :: ordset:ordset(trigger()),
- effect :: list()
+ triggers :: ordset:ordset(trigger())
}
).
@@ -25,7 +24,11 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
+-export
+(
+ [
+ ]
+).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LOCAL FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%