mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 16:07:55 +00:00
9ae272d753
- scriptified all Effect functions of Fastprojectile's children - implemented access to class meta data. - added a VM instruction to retrieve the class metadata, to eliminate the overhead of the function call that would otherwise be needed. - made GetClass() a builtin so that it can use the new instruction Important note about this commit: Scriptifying CFlameMissile::Effect revealed a problem with the virtual function interface: In order to work, this needs to be explicitly enabled for each single native class that may be used as a base for a scripted class. Needless to say, this will end up way too much work, as there are over 100 native classes, excluding those which will be scriptified. But in order to fix the problem this partially broken state needs to be committed first.
235 lines
3.7 KiB
Text
235 lines
3.7 KiB
Text
|
|
// The Cleric's Flame Strike ------------------------------------------------
|
|
|
|
class CWeapFlame : ClericWeapon
|
|
{
|
|
Default
|
|
{
|
|
+NOGRAVITY
|
|
Weapon.SelectionOrder 1000;
|
|
Weapon.AmmoUse 4;
|
|
Weapon.AmmoGive 25;
|
|
Weapon.KickBack 150;
|
|
Weapon.YAdjust 10;
|
|
Weapon.AmmoType1 "Mana2";
|
|
Inventory.PickupMessage "$TXT_WEAPON_C3";
|
|
Tag "$TAG_CWEAPFLAME";
|
|
}
|
|
|
|
action native void A_CFlameAttack();
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
WCFM ABCDEFGH 4 Bright;
|
|
Loop;
|
|
Select:
|
|
CFLM A 1 A_Raise;
|
|
Loop;
|
|
Deselect:
|
|
CFLM A 1 A_Lower;
|
|
Loop;
|
|
Ready:
|
|
CFLM AAAABBBBCCCC 1 A_WeaponReady;
|
|
Loop;
|
|
Fire:
|
|
CFLM A 2 Offset (0, 40);
|
|
CFLM D 2 Offset (0, 50);
|
|
CFLM D 2 Offset (0, 36);
|
|
CFLM E 4 Bright;
|
|
CFLM F 4 Bright A_CFlameAttack;
|
|
CFLM E 4 Bright;
|
|
CFLM G 2 Offset (0, 40);
|
|
CFLM G 2;
|
|
Goto Ready;
|
|
}
|
|
}
|
|
|
|
// Floor Flame --------------------------------------------------------------
|
|
|
|
class CFlameFloor : Actor
|
|
{
|
|
Default
|
|
{
|
|
+NOBLOCKMAP +NOGRAVITY
|
|
RenderStyle "Add";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
CFFX N 5 Bright;
|
|
CFFX O 4 Bright;
|
|
CFFX P 3 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// Flame Puff ---------------------------------------------------------------
|
|
|
|
class FlamePuff : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius 1;
|
|
Height 1;
|
|
+NOBLOCKMAP +NOGRAVITY
|
|
RenderStyle "Add";;
|
|
SeeSound "ClericFlameExplode";
|
|
AttackSound "ClericFlameExplode";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
CFFX ABC 3 Bright;
|
|
CFFX D 4 Bright;
|
|
CFFX E 3 Bright;
|
|
CFFX F 4 Bright;
|
|
CFFX G 3 Bright;
|
|
CFFX H 4 Bright;
|
|
CFFX I 3 Bright;
|
|
CFFX J 4 Bright;
|
|
CFFX K 3 Bright;
|
|
CFFX L 4 Bright;
|
|
CFFX M 3 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// Flame Puff 2 -------------------------------------------------------------
|
|
|
|
class FlamePuff2 : FlamePuff
|
|
{
|
|
States
|
|
{
|
|
Spawn:
|
|
CFFX ABC 3 Bright;
|
|
CFFX D 4 Bright;
|
|
CFFX E 3 Bright;
|
|
CFFX F 4 Bright;
|
|
CFFX G 3 Bright;
|
|
CFFX H 4 Bright;
|
|
CFFX IC 3 Bright;
|
|
CFFX D 4 Bright;
|
|
CFFX E 3 Bright;
|
|
CFFX F 4 Bright;
|
|
CFFX G 3 Bright;
|
|
CFFX H 4 Bright;
|
|
CFFX I 3 Bright;
|
|
CFFX J 4 Bright;
|
|
CFFX K 3 Bright;
|
|
CFFX L 4 Bright;
|
|
CFFX M 3 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// Circle Flame -------------------------------------------------------------
|
|
|
|
class CircleFlame : Actor
|
|
{
|
|
Default
|
|
{
|
|
Radius 6;
|
|
Damage 2;
|
|
DamageType "Fire";
|
|
Projectile;
|
|
-ACTIVATEIMPACT
|
|
-ACTIVATEPCROSS
|
|
RenderStyle "Add";
|
|
DeathSound "ClericFlameCircle";
|
|
Obituary "$OB_MPCWEAPFLAME";
|
|
}
|
|
|
|
native void A_CFlameRotate();
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
CFCF A 4 Bright;
|
|
CFCF B 2 Bright A_CFlameRotate;
|
|
CFCF C 2 Bright;
|
|
CFCF D 1 Bright;
|
|
CFCF E 2 Bright;
|
|
CFCF F 2 Bright A_CFlameRotate;
|
|
CFCF G 1 Bright;
|
|
CFCF HI 2 Bright;
|
|
CFCF J 1 Bright A_CFlameRotate;
|
|
CFCF K 2 Bright;
|
|
CFCF LM 3 Bright;
|
|
CFCF N 2 Bright A_CFlameRotate;
|
|
CFCF O 3 Bright;
|
|
CFCF P 2 Bright;
|
|
Stop;
|
|
Death:
|
|
CFCF QR 3 Bright;
|
|
CFCF S 3 Bright A_Explode(20, 20, 0);
|
|
CFCF TUVWXYZ 3 Bright;
|
|
Stop;
|
|
}
|
|
}
|
|
|
|
// Flame Missile ------------------------------------------------------------
|
|
|
|
class CFlameMissile : FastProjectile
|
|
{
|
|
Default
|
|
{
|
|
Speed 200;
|
|
Radius 14;
|
|
Height 8;
|
|
Damage 8;
|
|
DamageType "Fire";
|
|
+INVISIBLE
|
|
RenderStyle "Add";
|
|
Obituary "$OB_MPCWEAPFLAME";
|
|
}
|
|
|
|
native void A_CFlamePuff();
|
|
native void A_CFlameMissile();
|
|
|
|
States
|
|
{
|
|
Spawn:
|
|
CFFX A 4 Bright;
|
|
CFFX A 1 A_CFlamePuff;
|
|
Goto Death + 1;
|
|
Death:
|
|
CFFX A 1 Bright A_CFlameMissile;
|
|
CFFX ABC 3 Bright;
|
|
CFFX D 4 Bright;
|
|
CFFX E 3 Bright;
|
|
CFFX F 4 Bright;
|
|
CFFX G 3 Bright;
|
|
CFFX H 4 Bright;
|
|
CFFX I 3 Bright;
|
|
CFFX J 4 Bright;
|
|
CFFX K 3 Bright;
|
|
CFFX L 4 Bright;
|
|
CFFX M 3 Bright;
|
|
Stop;
|
|
}
|
|
|
|
override void BeginPlay ()
|
|
{
|
|
special1 = 2;
|
|
}
|
|
|
|
override void Effect ()
|
|
{
|
|
if (!--special1)
|
|
{
|
|
special1 = 4;
|
|
double newz = pos.z - 12;
|
|
if (newz < floorz)
|
|
{
|
|
newz = floorz;
|
|
}
|
|
Actor mo = Spawn ("CFlameFloor", (pos.xy, newz), ALLOW_REPLACE);
|
|
if (mo)
|
|
{
|
|
mo.angle = angle;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|