Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc bug fixes, Solo Survival Arena aggro adjustment. #921

Merged
merged 4 commits into from Mar 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 58 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 Expand Up @@ -6456,6 +6513,7 @@ messages:
TargetSwitch(what=$, iHatred = 0)
{
if what = $
OR poOwner = $
{
Debug("BAD target we're switching to here!");

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
27 changes: 21 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 Expand Up @@ -7305,6 +7312,14 @@ messages:
{
local iChange, iSwing, oRoom, oSpellDeathLink;

% No karma change in survival room. Mobs in this room *should*
% return 0 karma, but there are cases where it doesn't happen.
if poOwner <> $
AND IsClass(poOwner,&SurvivalRoom)
{
return 0;
}

% No karma changes from killing players during Frenzies.
% Also, no Karma change from event monsters: Xeos and admin-spawned.
if (Send(SYS,@GetChaosNight) AND NOT bIsMob)
Expand Down