Skip to content

Commit

Permalink
Misc attack related fixes.
Browse files Browse the repository at this point in the history
-Fixed Bramble Wall starting hit points (were being spawned with 0HP).
-Fixed Bramble Wall damage threshold messages.
-Stop thrasher spin attacks hitting phased/spectating players.
-Fix a bug causing thrasher spin attacks to overwrite the damage to be
done to each target with the value returned from the previous target.
-Changed thrasher spin attacks to use high precision damage numbers.
-Survival arena now checks for invalid targets before calling
TargetSwitch.
-Added IsOwnedByPlayer message in Monster. Returns TRUE if the monster
(or its master) is owned by a player, FALSE otherwise. Checks for
apparitions and monster evil twins in addition to true minions.
-Added minion checks to the aggro code in survival arenas, to stop
player minions being aggroed on players.
-Fixed bug causing new mobs to not aggro properly if a boss or miniboss
is present.
-Lowered solo aggro to 20% of mobs spawned.
-When one participant is left in guild survival, or on every kill in
solo, try to aggro another mob on the player.
-Fixed grammar error (her/his vs he/she) in phased out cast resource.
-Add a check for phase/spectator to CheckPlayerAttack in Spell.
-Formatting fixes in AttackSpell (no code change).
-Add phase/spectator check for Earthquake and radius projectile
targeting.
-Add immortal and phase/spectator check to Heat's damage effect.
-Add utility message (CreateSpellBook) to create a spell book for
monsters to use. Creates a one-spell spellbook only; good for testing.
-Add stats to keep track of highest level reached in each of the arenas.
-Add system message to get survival status report easier.
  • Loading branch information
skittles1 committed Mar 2, 2015
1 parent c51bf81 commit 83a0f58
Show file tree
Hide file tree
Showing 14 changed files with 389 additions and 82 deletions.
57 changes: 57 additions & 0 deletions kod/object/active/holder/nomoveon/battler/monster.kod
Expand Up @@ -6109,6 +6109,63 @@ messages:
return;
}

IsOwnedByPlayer()
"Checks the three cases of minions, and returns TRUE if owned by "
"a player, FALSE if not. If minion has a monster for a master, "
"IsOwnedByPlayer is called on the master."
{
if poMaster <> $
{
if IsClass(poMaster,&Player)
{
return TRUE;
}

if IsClass(poMaster,&Monster)
{
return Send(poMaster,@IsOwnedByPlayer);
}

% Could be a room or an item that owns the monster.
% If we allow players to attach minions to guild halls
% or other creative uses of non-player/monster owners,
% we may need to change this.
return FALSE;
}

if poApparitionCaster <> $
{
if IsClass(poApparitionCaster,&Player)
{
return TRUE;
}

if IsClass(poApparitionCaster,&Monster)
{
return Send(poApparitionCaster,@IsOwnedByPlayer);
}

return FALSE;
}

if poEvilTwinCaster <> $
{
if IsClass(poEvilTwinCaster,&Player)
{
return TRUE;
}

if IsClass(poEvilTwinCaster,&Monster)
{
return Send(poEvilTwinCaster,@IsOwnedByPlayer);
}

return FALSE;
}

return FALSE;
}

% This section deals with minion code.
CommandMinionAttack(oMaster=$,oTarget=$)
{
Expand Down
8 changes: 4 additions & 4 deletions kod/object/active/holder/nomoveon/battler/monster/BRAMBLE.kod
Expand Up @@ -128,7 +128,7 @@ messages:

Constructed()
{
piHit_points = piBrambleHits;
piHit_points = piBrambleHits * 100;
piMax_hit_points = piBrambleHits;

propagate;
Expand Down Expand Up @@ -272,21 +272,21 @@ messages:
return;
}

if iDamage < 3
if iDamage <= 200
{
Send(what,@MsgSendUser,#message_rsc=Brambles_damage2);

return;
}

if iDamage = 3
if iDamage <= 300
{
Send(what,@MsgSendUser,#message_rsc=Brambles_damage3);

return;
}

if iDamage = 4
if iDamage <= 400
{
Send(what,@MsgSendUser,#message_rsc=Brambles_damage4);

Expand Down
15 changes: 9 additions & 6 deletions kod/object/active/holder/nomoveon/battler/monster/thrasher.kod
Expand Up @@ -17,8 +17,10 @@ constants:

PALSY_CHANCE = 20

SPIN_DAMAGE_MIN = 7
SPIN_DAMAGE_MAX = 15
% These are high precision damage amounts, with two 'decimal places'.
% Actual damage shown to player will be (default) 7-15.
SPIN_DAMAGE_MIN = 700
SPIN_DAMAGE_MAX = 1500

resources:

Expand Down Expand Up @@ -344,12 +346,13 @@ messages:
each_obj = Send(oRoom,@HolderExtractObject,#data=i);
if IsClass(each_obj,&User)
AND Send(self,@CanReach,#what=each_obj)
AND (NOT Send(each_obj,@IsInCannotInteractMode))
{
lValidTargets = Cons(each_obj,lValidTargets);
}
}

return lValidTargets;
return lValidTargets;
}

DoSpinAttack(lFinalTargets=$)
Expand All @@ -367,9 +370,9 @@ messages:

for i in lTargets
{
iDamage = Send(i,@AssessDamage,#what=self,#damage=iDamage,
#atype=viAttack_type,#aspell=viAttack_spell);
if iDamage = $
if Send(i,@AssessDamage,#what=self,#damage=iDamage,
#atype=viAttack_type,#aspell=viAttack_spell,
#precision=TRUE) = $
{
Send(self,@KilledSomething,#what=i,#use_weapon=self);
}
Expand Down
19 changes: 13 additions & 6 deletions kod/object/active/holder/nomoveon/battler/player.kod
Expand Up @@ -5239,8 +5239,12 @@ messages:
origdamage = damage/100;
color_rsc = player_hit_color_none;

% Attacks against a minion master will cause minions to defend the master
Send(self,@CommandMinionAttack,#oMaster=self,#oTarget=what);
% Attacks against a minion master will cause minions to defend the master.
if what <> $
AND IsClass(what,&Battler)
{
Send(self,@CommandMinionAttack,#oMaster=self,#oTarget=what);
}

if what <> $ AND IsClass(what,&monster)
{
Expand Down Expand Up @@ -5275,7 +5279,8 @@ messages:
#caster=Nth(i,3),#resistance=iResistance);
}

damage = Send(self,@GetDamageFromResistance,#what=damage,#value=iResistance);
damage = Send(self,@GetDamageFromResistance,#what=damage,
#value=iResistance);

% Allow protective spells a chance to improve when they take effect!
for i in plPassiveImprovement
Expand Down Expand Up @@ -5391,12 +5396,14 @@ messages:
if piHealth <= 0
{
if stroke_obj = $
OR NOT Send(stroke_obj,@PlayerWasKilledMsg,#who=self,#attacker=what,#damage=$)
OR NOT Send(stroke_obj,@PlayerWasKilledMsg,#who=self,
#attacker=what,#damage=$)
{
if report
{
Send(self,@MsgSendUser,#message_rsc=Send(self,@PlayerWasHit,#atype=atype,#aspell=aspell),
#parm1=color_rsc,#parm2=Send(what,@GetCapDef),#parm3=Send(what,@GetName));
Send(self,@MsgSendUser,#message_rsc=Send(self,@PlayerWasHit,
#atype=atype,#aspell=aspell),#parm1=color_rsc,
#parm2=Send(what,@GetCapDef),#parm3=Send(what,@GetName));
}
}

Expand Down

0 comments on commit 83a0f58

Please sign in to comment.