5 ullrbone() : TimesUsed(0), Charges(12) {}
6 virtual truth
Zap (character
*, v2
, int);
7 virtual void ChargeFully (character
*) { TimesUsed
= 0; }
8 virtual truth
IsZappable (const character
*) const { return true; }
9 virtual truth
IsChargeable (const character
*) const { return true; }
10 virtual truth
HitEffect (character
*, character
*, v2
, int, int, truth
);
12 virtual void AddInventoryEntry (const character
*, festring
&, int, truth
) const;
13 virtual truth
ReceiveDamage (character
*, int, int, int);
14 virtual truth
AllowAlphaEverywhere () const { return true; }
18 virtual int GetClassAnimationFrames () const { return 32; }
19 virtual col16
GetOutlineColor (int) const;
20 virtual alpha
GetOutlineAlpha (int) const;
28 col16
ullrbone::GetOutlineColor (int) const { return MakeRGB16(210, 210, 210); }
32 truth
ullrbone::HitEffect (character
*Enemy
, character
*Hitter
, v2 HitPos
, int BodyPartIndex
, int Direction
, truth BlockedByArmour
) {
33 truth BaseSuccess
= item::HitEffect(Enemy
, Hitter
, HitPos
, BodyPartIndex
, Direction
, BlockedByArmour
);
34 if (Enemy
->IsEnabled() && (RAND() & 1)) {
35 if (Enemy
->IsPlayer() || Hitter
->IsPlayer() || Enemy
->CanBeSeenByPlayer() || Hitter
->CanBeSeenByPlayer())
36 ADD_MESSAGE("A burst of %s bone of Ullr's unholy energy fries %s.", Hitter
->CHAR_POSSESSIVE_PRONOUN
, Enemy
->CHAR_DESCRIPTION(DEFINITE
));
37 return Enemy
->ReceiveBodyPartDamage(Hitter
, 3 + (RAND() & 3), ENERGY
, BodyPartIndex
, Direction
) || BaseSuccess
;
44 truth
ullrbone::Zap (character
*Zapper
, v2
, int Direction
) {
45 if (Charges
> TimesUsed
) {
46 ADD_MESSAGE("BANG! You zap %s!", CHAR_NAME(DEFINITE
));
47 Zapper
->EditExperience(PERCEPTION
, 150, 1 << 10);
50 CONST_S("killed by ") + GetName(INDEFINITE
),
58 (GetLevel()->*level::GetBeam(PARTICLE_BEAM
))(Beam
);
61 ADD_MESSAGE("Click!");
68 void ullrbone::AddInventoryEntry (const character
*Viewer
, festring
& Entry
, int, truth ShowSpecialInfo
) const {
70 AddName(Entry
, INDEFINITE
);
71 if (ShowSpecialInfo
) {
72 Entry
<< " [" << GetWeight() << "g, DAM " << GetBaseMinDamage() << '-' << GetBaseMaxDamage();
73 Entry
<< ", " << GetBaseToHitValueDescription();
74 if (!IsBroken()) Entry
<< ", " << GetStrengthValueDescription();
75 int CWeaponSkillLevel
= Viewer
->GetCWeaponSkillLevel(this);
76 int SWeaponSkillLevel
= Viewer
->GetSWeaponSkillLevel(this);
77 if (CWeaponSkillLevel
|| SWeaponSkillLevel
) Entry
<< ", skill " << CWeaponSkillLevel
<< '/' << SWeaponSkillLevel
;
78 if (TimesUsed
== 1) Entry
<< ", used 1 time";
79 else if (TimesUsed
) Entry
<< ", used " << TimesUsed
<< " times";
86 truth
ullrbone::ReceiveDamage (character
*Damager
, int Damage
, int Type
, int) {
87 if (TimesUsed
!= 12 && Type
& (PHYSICAL_DAMAGE
|FIRE
|ENERGY
) && Damage
&& (Damage
> 50 || !(RAND() % (100 / Damage
)))) {
88 festring DeathMsg
= CONST_S("killed by an explosion of ");
89 AddName(DeathMsg
, INDEFINITE
);
90 if (Damager
) DeathMsg
<< " caused @bk";
91 if (GetSquareUnder()->CanBeSeenByPlayer(true)) ADD_MESSAGE("%s explodes!", GetExtendedDescription().CStr());
92 lsquare
*Square
= GetLSquareUnder();
95 Square
->GetLevel()->Explosion(Damager
, DeathMsg
, Square
->GetPos(), (6-TimesUsed
)*50);
103 alpha
ullrbone::GetOutlineAlpha (int Frame
) const {
105 return 50+(Frame
*(31-Frame
)>>1);