Back to the Vavoom Forum Archives
TheCount
void A_FSwordAttack() { int damage; int i; int as;//the variable is called as because of the as de espadas, ace of spades (mora accurately transatable for "ace of swords") :P TAVec angles; TVec vforward; damage = 200 + (P_Random() & 15); for (i = 0; i < 16; i++) { angles = Player.MO.Angles; angles.yaw = AngleMod360(angles.yaw + itof(i) * (45.0 / 16.0)); Actor(Player.MO).AimLineAttack(&angles, 2.0 * Actor::MELEERANGE); if (Actor(Player.MO).linetarget) { AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, 2.0 * Actor::MELEERANGE, damage, HammerPuff)) { Player.MO.PlaySound('FighterHammerMiss', CHAN_WEAPON); as=1; } Player(Player).AdjustPlayerAngle(); return; } angles = Player.MO.Angles; angles.yaw = AngleMod360(angles.yaw - itof(i) * (45.0 / 16.0)); Actor(Player.MO).AimLineAttack(&angles, 2.0 * Actor::MELEERANGE); if (Actor(Player.MO).linetarget) { AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, 2.0 * Actor::MELEERANGE, damage, HammerPuff)) { Player.MO.PlaySound('FighterHammerMiss', CHAN_WEAPON); as=1; } Player(Player).AdjustPlayerAngle(); return; } } // didn't find any creatures, so try to strike any walls angles = Player.MO.Angles; Actor(Player.MO).AimLineAttack(&angles, Actor::MELEERANGE); AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, Actor::MELEERANGE, damage, HammerPuff)) { Player.MO.PlaySound('FighterHammerMiss', CHAN_WEAPON); as=1; } if (as==1) { PlayerPawn Owner = PlayerPawn(Player.MO); Player(Player).Mana[HexenDefs::MANA_1] -= WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon); Player(Player).Mana[HexenDefs::MANA_2] -= WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, -10.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw + 45.0 / 4.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, -5.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw + 45.0 / 8.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin, FighterSwordMissile, Owner.Angles.yaw); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, 5.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw - 45.0 / 8.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, 10.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw - 45.0 / 4.0)); Owner.PlaySound('FighterSwordFire', CHAN_WEAPON); } }So, I want to make it fire-damaging. I've tried to look it up in the cone of shards code, but I don't understand <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> Actually, I don't understand this melee attack either, but all I did was changing the damage and creating an "as" variable to control whether to fire missiles or not. All other escapes my understanding. Another thing, the weapon doesn't consume mana in melee attacks, just as I want, but it can't attack either way if it's out of mana. Any help is appreciated. Thank you very much
Crimson Wizard
bFireDamage = true;If you want projectiles have fire damage, add the same line to FighterSwordMissile class. As for using melee attack w/o mana check WeaponFighterAxe class, it acts the same (with only difference that it doesn't has missile attack ,just more strong melee with mana available).
Janis Legzdinsh
Fire damaging. If you want fire damage for melee attacks add following in "defaultproperties" section of WeaponFighterSword class (i.e. Quietus itself):Wrong, weapon class is not an actor. For melee weapons you must temporarely set player to have this flag and clear it afterwards. Take a look how mage's ice damage works.bFireDamage = true;
Crimson Wizard
Actor(Player.MO).bFireDamage = true; Actor(Player.MO).LineAttack(vforward, 2.0 * Actor::MELEERANGE, damage, HammerPuff); Actor(Player.MO).bFireDamage = false;
Crimson Wizard
Janis Legzdinsh
TheCount
Crimson Wizard
TheCount
Crimson Wizard
TheCount
void A_FSwordAttack() { int damage; int i; int as; TAVec angles; TVec vforward; Actor(Player.MO).bFireDamage = true; damage = 200 + (P_Random() & 15); for (i = 0; i < 16; i++) { angles = Player.MO.Angles; angles.yaw = AngleMod360(angles.yaw + itof(i) * (45.0 / 16.0)); Actor(Player.MO).AimLineAttack(&angles, 2.0 * Actor::MELEERANGE); if (Actor(Player.MO).linetarget) { AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, 2.0 * Actor::MELEERANGE, damage, HammerPuff)) { Player.MO.PlaySound('FighterSwordFire', CHAN_WEAPON); as=1; } Player(Player).AdjustPlayerAngle(); Actor(Player.MO).bFireDamage = false; return; } angles = Player.MO.Angles; angles.yaw = AngleMod360(angles.yaw - itof(i) * (45.0 / 16.0)); Actor(Player.MO).AimLineAttack(&angles, 2.0 * Actor::MELEERANGE); if (Actor(Player.MO).linetarget) { AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, 2.0 * Actor::MELEERANGE, damage, HammerPuff)) { as=1; } Player(Player).AdjustPlayerAngle(); Actor(Player.MO).bFireDamage = false; return; } } // didn't find any creatures, so try to strike any walls angles = Player.MO.Angles; Actor(Player.MO).AimLineAttack(&angles, Actor::MELEERANGE); AngleVector(&angles, &vforward); if (Actor(Player.MO).LineAttack(vforward, Actor::MELEERANGE, damage, HammerPuff)) { as=1; } if (Player(Player).Mana[HexenDefs::MANA_1] < WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon)) { as=0; } if (Player(Player).Mana[HexenDefs::MANA_2] < WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon)) { as=0; } Actor(Player.MO).bFireDamage = false; if (as==1) { PlayerPawn Owner = PlayerPawn(Player.MO); Player(Player).Mana[HexenDefs::MANA_1] -= WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon); Player(Player).Mana[HexenDefs::MANA_2] -= WeaponManaUse(Player.PClass, Player(Player).ReadyWeapon); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, -10.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw + 45.0 / 4.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, -5.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw + 45.0 / 8.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin, FighterSwordMissile, Owner.Angles.yaw); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, 5.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw - 45.0 / 8.0)); Player(Player).SpawnPlayerMissileAngleXYZ(Owner.Origin + vector(0.0, 0.0, 10.0), FighterSwordMissile, AngleMod360(Owner.Angles.yaw - 45.0 / 4.0)); Owner.PlaySound('FighterSwordFire', CHAN_WEAPON); } }It's a very nasty weapon <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Thanks a lot
Crimson Wizard
Firebrand
Crimson Wizard
TheCount
Janis Legzdinsh
TheCount
Crimson Wizard
TheCount
TheCount
Janis Legzdinsh
TheCount