Permalink
Browse files

Made the snake use the stun and agility dampening effects for its att…

…acks.

This make that enemy much more dangerous.
  • Loading branch information...
1 parent ec58a97 commit ec5a25a65aa8947953dd3956ba96fe5c590c64e3 Yohann Ferreira committed Oct 29, 2012
Showing with 92 additions and 29 deletions.
  1. +17 −15 dat/actors/enemies.lua
  2. +75 −14 dat/skills/attack.lua
View
@@ -181,7 +181,7 @@ enemies[3] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -206,15 +206,15 @@ enemies[4] = {
sprite_height = 64,
base_stats = {
- hit_points = 85,
- skill_points = 0,
+ hit_points = 125,
+ skill_points = 10,
strength = 22,
- vigor = 0,
- fortitude = 6,
+ vigor = 20,
+ fortitude = 8,
protection = 5,
agility = 30,
evade = 6.0,
- experience_points = 20,
+ experience_points = 25,
drunes = 12
},
@@ -247,7 +247,9 @@ enemies[4] = {
},
skills = {
- 1003 -- Normal attack
+ 1003, -- Normal attack
+ 1004, -- Stun bite
+ 1005 -- Dampening bite (Agility lowering attack)
},
drop_objects = {
@@ -303,7 +305,7 @@ enemies[5] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -544,7 +546,7 @@ enemies[9] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -607,7 +609,7 @@ enemies[10] = {
},
skills = {
- 1004, -- Normal attack
+ 1006, -- Normal attack
7 -- Fire burst
},
@@ -671,7 +673,7 @@ enemies[11] = {
},
skills = {
- 1004, -- Normal attack
+ 1006, -- Normal attack
10002 -- First Aid
},
@@ -719,7 +721,7 @@ enemies[12] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -766,7 +768,7 @@ enemies[13] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -813,7 +815,7 @@ enemies[14] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
@@ -860,7 +862,7 @@ enemies[15] = {
},
skills = {
- 1004
+ 1006
},
drop_objects = {
View
@@ -28,12 +28,31 @@
-- sprites.
------------------------------------------------------------------------------]]
+-- common functions
+function trigger_potential_stun(user, target)
+ local target_actor = target:GetActor();
+ local attack_point = target_actor:GetAttackPoint(target:GetPoint());
+ local chance_modifier = (user:GetTotalMetaphysicalAttack() - attack_point:GetTotalMetaphysicalDefense()) * 3.0;
+ local chance = (hoa_utils.RandomFloat() * 100.0);
+ --print( chance.. "/".. 50.0 + chance_modifier);
+ if (chance > (50.0 + chance_modifier)) then
+ target_actor:RegisterMiss(true);
+ return;
+ end
+
+ -- Compute an effect duration time based on the characters' stats
+ local effect_duration = (user:GetVigor() - target_actor:GetProtection()) * 2000;
+ if (effect_duration < 15000) then effect_duration = 15000; end
+ target_actor:RegisterStatusChange(hoa_global.GameGlobal.GLOBAL_STATUS_PARALYSIS,
+ hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_LESSER,
+ effect_duration);
+end
+
-- All attack skills definitions are stored in this table
if (skills == nil) then
skills = {}
end
-
--------------------------------------------------------------------------------
-- IDs 1 - 1,000 are reserved for character attack skills
--------------------------------------------------------------------------------
@@ -108,19 +127,7 @@ skills[3] = {
if (hoa_battle.CalculateStandardEvasionAdder(target, 5.5) == false) then
-- Calculate chance for paralysis effect and activate it
- local attack_point = target_actor:GetAttackPoint(target:GetPoint());
- local chance_modifier = (user:GetTotalMetaphysicalAttack() - attack_point:GetTotalMetaphysicalDefense()) * 3.0;
- local chance = (hoa_utils.RandomFloat() * 100.0);
- if (chance <= (50.0 + chance_modifier)) then
- -- Compute an effect duration time based on the characters' stats
- local effect_duration = (user:GetVigor() - target_actor:GetProtection()) * 2000;
- if (effect_duration < 5000) then effect_duration = 5000; end
- target_actor:RegisterStatusChange(hoa_global.GameGlobal.GLOBAL_STATUS_PARALYSIS,
- hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_LESSER,
- effect_duration);
- else
- target_actor:RegisterMiss(true);
- end
+ trigger_potential_stun(user, target);
-- The damages are applied after the potential effects, so that a potential target death handles the effect removal properly
target_actor:RegisterDamage(hoa_battle.CalculatePhysicalDamage(user, target));
@@ -150,6 +157,10 @@ skills[4] = {
target_actor = target:GetActor();
if (hoa_battle.CalculateStandardEvasionAdder(target, 8.5) == false) then
+ target_actor:RegisterStatusChange(hoa_global.GameGlobal.GLOBAL_STATUS_AGILITY_LOWER,
+ hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_GREATER,
+ effect_duration);
+
target_actor:RegisterDamage(hoa_battle.CalculatePhysicalDamageAdder(user, target, 20), target);
AudioManager:PlaySound("snd/swordslice2.wav");
else
@@ -303,6 +314,56 @@ skills[1003] = {
}
skills[1004] = {
+ name = "Snake Stun Bite",
+ sp_required = 1,
+ warmup_time = 900,
+ cooldown_time = 0,
+ target_type = hoa_global.GameGlobal.GLOBAL_TARGET_FOE_POINT,
+
+ BattleExecute = function(user, target)
+ target_actor = target:GetActor();
+
+ if (hoa_battle.CalculateStandardEvasion(target) == false) then
+ -- Calculate chance for paralysis effect and activate it
+ trigger_potential_stun(user, target);
+
+ -- The damages are applied after the potential effects, so that a potential target death handles the effect removal properly
+ target_actor:RegisterDamage(hoa_battle.CalculatePhysicalDamageAdder(user, target, 14), target);
+ AudioManager:PlaySound("snd/snake_attack.wav");
+ else
+ target_actor:RegisterMiss(true);
+ end
+ end
+}
+
+skills[1005] = {
+ name = "Snake Dampening Bite",
+ sp_required = 1,
+ warmup_time = 900,
+ cooldown_time = 0,
+ target_type = hoa_global.GameGlobal.GLOBAL_TARGET_FOE_POINT,
+
+ BattleExecute = function(user, target)
+ target_actor = target:GetActor();
+
+ if (hoa_battle.CalculateStandardEvasion(target) == false) then
+ target_actor = target:GetActor();
+ local effect_duration = user:GetProtection() * 2000;
+ if (effect_duration < 15000) then effect_duration = 15000 end
+ target_actor:RegisterStatusChange(hoa_global.GameGlobal.GLOBAL_STATUS_AGILITY_LOWER,
+ hoa_global.GameGlobal.GLOBAL_INTENSITY_POS_GREATER,
+ effect_duration);
+
+ -- The damages are applied after the potential effects, so that a potential target death handles the effect removal properly
+ target_actor:RegisterDamage(hoa_battle.CalculatePhysicalDamageAdder(user, target, 14), target);
+ AudioManager:PlaySound("snd/snake_attack.wav");
+ else
+ target_actor:RegisterMiss(true);
+ end
+ end
+}
+
+skills[1006] = {
name = "Skeleton Sword Attack",
sp_required = 0,
warmup_time = 1400,

0 comments on commit ec5a25a

Please sign in to comment.