Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions kod/include/blakston.khd
Original file line number Diff line number Diff line change
Expand Up @@ -2066,7 +2066,16 @@
SKID_PROFICIENCY_SHORT_SWORD = 457
% Duplicate, for the easily confused.
SKID_PROFICIENCY_SHORTSWORD = 457


% Witchery skills
SKID_ARCANE_KNOWLEDGE = 458
SKID_ROTE_MEMORIZATION = 459
SKID_EFFICIENT_CASTING = 460
SKID_ANCIENT_PACT = 461
SKID_UNHALLOWED_RUNES = 462
SKID_BLOOD_RUNES = 463
SKID_OSTRACIZATION = 464

% Sorcery skills
SKID_LINK_ONE = 480
SKID_LINK_TWO = 481
Expand Down Expand Up @@ -2305,6 +2314,26 @@

SID_BATTLE_CONTROL = 240

SID_HEX_VULNERABILITY = 250
SID_HEX_SLOW = 251
SID_HEX_LEECHES = 252
SID_HEX_FRAILTY = 253
SID_HEX_BARBS = 254
SID_HEX_HUMILITY = 255
SID_HEX_CORRUPTION = 256
SID_HEX_FLAMMABILITY = 257
SID_HEX_CONDUCTIVITY = 258
SID_HEX_ALGIDITY = 259
SID_HEX_CORROSION = 260
SID_HEX_FESTER = 261
SID_HEX_MUTE = 262
SID_HEX_WEAKEN = 263
SID_HEX_EXHAUSTION = 264
SID_HEX_SAP = 265
SID_HEX_BESTILL = 266
SID_HEX_BECLOUD = 267
SID_HEX_BLACK_MANTLE = 268

SID_GREY_GHOST = 300

% Depreciated spell IDs
Expand Down Expand Up @@ -2386,9 +2415,10 @@
SS_WITCHERY = 8

% Subschools
SS_WITCHERY_XAERDUN = 1
SS_WITCHERY_NEQUZON = 2
SS_WITCHERY_IWODACH = 3
SSS_WITCHERY_XAERDUN = 1
SSS_WITCHERY_NEQUZON = 2
SSS_WITCHERY_IWODACH = 3
SSS_WITCHERY_RAUMLAR = 4

% We may use skill an spell schools in the same routines, thus no overlap.
SKS_FENCING = 10
Expand Down
73 changes: 73 additions & 0 deletions kod/object/active/holder/nomoveon/battler.kod
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ properties:
plStatusEffects = $
ptStatusEffectTimer = $

% Negative values mean more vulnerable to hexes, positive values resist
% -100 is doubled effect, 100 is total immunity
piHexResistance = 0

messages:

% The first lump of code here deals with resistances and immunities/etc.
Expand Down Expand Up @@ -2236,5 +2240,74 @@ messages:
return FALSE;
}

GetHexes()
{
local oEnch, lHexes;

lHexes = $;
foreach oEnch in plEnchantments
{
if Send(Nth(oEnch,2),@UseHexBehavior)
{
lHexes = Cons(Nth(oEnch,2),lHexes);
}
}

return lHexes;
}

GetNumHexes()
{
local oEnch, iNumHexes;

iNumHexes = 0;
foreach oEnch in plEnchantments
{
if Send(Nth(oEnch,2),@UseHexBehavior)
{
iNumHexes = iNumHexes + 1;
}
}

return iNumHexes;
}

RemoveRandomHex(exempt=$)
{
local lHexes;

lHexes = Send(self,@GetHexes);
if exempt <> $
AND lHexes <> $
AND FindListElem(lHexes,exempt) <> 0
{
lHexes = DelListElem(lHexes,exempt);
}

if lHexes <> $
AND Length(lHexes) > 0
{
Send(self,@RemoveEnchantment,
#what=Nth(lHexes,Random(1,Length(lHexes))));
}

return;
}

GetHexResistance()
{
return bound(piHexResistance,-100,100);
}

GetHexIncEffect(iSpellPower=0)
{
return iSpellPower+1;
}

GetCasterMaxHexes()
{
return Send(SETTINGS_OBJECT,@GetHexesMax);
}

end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 changes: 51 additions & 8 deletions kod/object/active/holder/nomoveon/battler/monster.kod
Original file line number Diff line number Diff line change
Expand Up @@ -2122,7 +2122,7 @@ messages:
GetOffense(what = $, stroke_obj=$)
"This returns the battler's ability to-hit. Ranges from 1 to 2000."
{
local iAttack;
local iAttack, i;

if piOffense = $
{
Expand All @@ -2132,7 +2132,7 @@ messages:
{
iAttack = piOffense;
}

if piChampionStatus = CHAMPION_DEADLY
OR piChampionStatus = CHAMPION_INDOMITABLE
{
Expand All @@ -2149,14 +2149,21 @@ messages:
iAttack = iAttack * 3 / 4;
}

foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex)
{
iAttack = Send(Nth(i,2),@ModifyHitRoll,
#who=self,#what=what,#hit_roll=iAttack,
#state=Nth(i,3));
}

return Bound(iAttack,1,2000);
}

GetDefense(what = $, stroke_obj=$)
"This returns the battler's ability to avoid being hit. Ranges from "
"1 to 2000."
{
local iDefense, iShocked;
local iDefense, iShocked, i;

if piDefense = $
{
Expand All @@ -2166,7 +2173,14 @@ messages:
{
iDefense = piDefense;
}


foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex)
{
iDefense = Send(Nth(i,2),@ModifyDefensePower,
#who=self,#what=what,#defense_power=iDefense,
#state=Nth(i,3));
}

if piChampionStatus = CHAMPION_TOUGH
OR piChampionStatus = CHAMPION_INDOMITABLE
{
Expand Down Expand Up @@ -2207,7 +2221,7 @@ messages:
% This returns the damage done to target "what"
GetDamage(what = $, stroke_obj=$)
{
local iDamage, iMultiplier;
local iDamage, iMultiplier, i;

iMultiplier = 1;

Expand Down Expand Up @@ -2243,7 +2257,14 @@ messages:
{
iMultiplier = 3;
}


foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex)
{
iDamage = Send(Nth(i,2),@ModifyDamage,
#who=self,#what=what,#damage=iDamage,
#state=Nth(i,3));
}

return Bound(iDamage,0,$) * iMultiplier;
}

Expand Down Expand Up @@ -2290,6 +2311,12 @@ messages:
local iDamage, iResist, iPercentClass, i, each_obj, bAttackerEmpowered,
oSpell, iCorrode, iCorrodeMultiple, iCorrodeReduction;

% Check for stat steals
foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&DrainHex)
{
Send(Nth(i,2),@StealStat,#who=what,#what=self,#state=Nth(i,3));
}

if NOT precision
{
damage = damage * 100;
Expand Down Expand Up @@ -5223,16 +5250,32 @@ messages:

HealHitPoint()
{
local iPercentClass, i, each_obj;
local iPercentClass, i, each_obj, iModifiedGain;

if piHit_points >= piMax_Hit_points * 100
{
return;
}

% Start with full 100% of hit point
iModifiedGain = 100;

foreach i in Send(self,@GetEnchantmentsByClass,#enchClass=&Hex)
{
iModifiedGain = Send(Nth(i,2),@ModifyRegenAmount,
#state=Nth(i,3),#regen=iModifiedGain);
}

% Don't drain below zero
if iModifiedGain < 0
AND piHit_points <= 100
{
iModifiedGain = 0;
}

% We set a mark to see if the healing changes our threshold
iPercentClass = piHit_points / (piMax_Hit_points * 20);
piHit_points = piHit_points + 100;
piHit_points = piHit_points + iModifiedGain;
if iPercentClass <> (piHit_points / (piMax_Hit_points * 20))
{
Send(self,@HitPointThresholdHeal);
Expand Down
Loading