Browse Source

allow assassin to sprint

master
Alison Watson 2 months ago
parent
commit
d9eb156cf5
5 changed files with 96 additions and 24 deletions
  1. +0
    -6
      pk7/lzscript/4_Wanderer/Wanderer.zsc
  2. +73
    -0
      pk7/lzscript/5_Assassin/0_Weapon.zsc
  3. +2
    -2
      pk7/lzscript/5_Assassin/2_DualPistols.zsc
  4. +21
    -10
      pk7/lzscript/5_Assassin/Assassin.zsc
  5. +0
    -6
      pk7/lzscript/7_Thoth/Thoth.zsc

+ 0
- 6
pk7/lzscript/4_Wanderer/Wanderer.zsc View File

@@ -59,12 +59,6 @@ class Lith_WandererPlayer : Lith_Player {
}
}

class Lith_ItemSpriteW : Lith_ItemSprite {
default {
VisibleToPlayerClass "Lith_WandererPlayer";
}
}

class Lith_WWeapon : Lith_Weapon {
default {
Inventory.RestrictedTo "Lith_WandererPlayer";


+ 73
- 0
pk7/lzscript/5_Assassin/0_Weapon.zsc View File

@@ -0,0 +1,73 @@
class Lith_AWeapon : Lith_Weapon;

default {
Inventory.RestrictedTo "Lith_AssassinPlayer";
}

override state Lith_Ready(int flags) {
if(Lith_AssassinPlayer(owner).m_isSprinting) {
return resolveState("_Sprint");
} else {
return null;
}
}

action(Weapon) void Lith_Sprint() {
self.GiveInventory("Lith_AssassinSprint", 1);
}

action(Weapon) state Lith_JumpIfSprint() {
if(vel.xy.length() < 8)
player.getPSprite(PSP_WEAPON).frame = 99;

if(getPlayerInput(INPUT_BUTTONS) & BT_SPEED == 0)
return resolveState("_SprintDone");
else
return null;
}

states(Weapon) {
_Sprint:
#### # 1 offset(1, 34);
#### # 1 offset(4, 40);
#### # 1 offset(10, 55);
#### # 1 offset(17, 70);
#### # 1 offset(21, 90);
#### # 1 offset(24, 120);
#### # 1 offset(25, 160) Lith_Sprint;
TNT1 A 1 offset(1, 32) {
Lith_Sprint();
A_Overlay(_psp_double_lg, "Null");
A_Overlay(_psp_double_rg, "Null");
}
_SprintLoop:
ASPG A 0 Lith_JumpIfSprint;
ASPG # 1 offset(-18, 45) Lith_Sprint;
ASPG # 1 offset(-9, 35) Lith_Sprint;
ASPG # 1 offset(-2, 34) Lith_Sprint;
ASPG # 1 offset(-1, 33) Lith_Sprint;
ASPG # 1 offset(-1, 32) Lith_Sprint;
ASPG # 1 offset(1, 32) Lith_Sprint;
ASPG # 1 offset(3, 35) Lith_Sprint;
ASPG # 1 offset(7, 39) Lith_Sprint;
ASPG # 1 offset(14, 44) Lith_Sprint;
ASPG # 1 offset(20, 45) Lith_Sprint;
ASPG B 0 Lith_JumpIfSprint;
ASPG # 1 offset(18, 45) Lith_Sprint;
ASPG # 1 offset(9, 35) Lith_Sprint;
ASPG # 1 offset(2, 34) Lith_Sprint;
ASPG # 1 offset(1, 33) Lith_Sprint;
ASPG # 1 offset(1, 32) Lith_Sprint;
ASPG # 1 offset(-1, 32) Lith_Sprint;
ASPG # 1 offset(-3, 35) Lith_Sprint;
ASPG # 1 offset(-7, 39) Lith_Sprint;
ASPG # 1 offset(-14, 44) Lith_Sprint;
ASPG # 1 offset(-20, 45) Lith_Sprint;
loop;
_SprintDone:
TNT1 A 1 offset(1, 32) A_Lower(60);
TNT1 A 0 resolveState("Select");
stop;
}

// EOF

+ 2
- 2
pk7/lzscript/5_Assassin/2_DualPistols.zsc View File

@@ -49,7 +49,7 @@ Fire:
FireLH:
DPIS B 0 A_StartSound("weapons/dualpistols/firel", lch_weapon);
DPIS E 1 bright {
A_OverlayOffset(_psp_double_lg, FRandom(0.1, 0.5) * -5.0, FRandom(0, 5), WOF_INTERPOLATE);
A_OverlayOffset(_psp_double_lg, FRandom(0.1, 0.5) * -15.0, FRandom(0, 5), WOF_INTERPOLATE);
Lith_A_FireDualPistols(-10);
}
DPIS F 1 bright A_OverlayOffset(_psp_double_lg, -4, 2, WOF_ADD|WOF_INTERPOLATE);
@@ -60,7 +60,7 @@ FireLH:
FireRH:
DPIS A 0 A_StartSound("weapons/dualpistols/firer", lch_weapon2);
DPIS C 1 bright {
A_OverlayOffset(_psp_double_rg, FRandom(0.1, 0.5) * 5.0, FRandom(0, 5), WOF_INTERPOLATE);
A_OverlayOffset(_psp_double_rg, FRandom(0.1, 0.5) * 15.0, FRandom(0, 5), WOF_INTERPOLATE);
Lith_A_FireDualPistols(10);
}
DPIS D 1 bright A_OverlayOffset(_psp_double_rg, 4, 2, WOF_ADD|WOF_INTERPOLATE);


+ 21
- 10
pk7/lzscript/5_Assassin/Assassin.zsc View File

@@ -15,7 +15,9 @@ class Lith_AssassinPlayer : Lith_Player {
Tag "Assassin";
}

private int m_dodgeDbc;
int m_dodgeDbc;
bool m_isSprinting;
bool m_wasHorizontalDodge;

override void giveDefaultInventory() {
super.giveDefaultInventory();
@@ -30,8 +32,16 @@ class Lith_AssassinPlayer : Lith_Player {
vel.y *= 0.9;
}
m_dodgeDbc--;
if(player && m_dodgeDbc == 15 && player.buttons & BT_SPEED &&
m_wasHorizontalDodge) {
m_isSprinting = true;
}
} else if(player) {
if(player.buttons & BT_SPEED) {
if(m_isSprinting) {
if(!(player.buttons & BT_SPEED)) {
m_isSprinting = false;
}
} else if(player.buttons & BT_SPEED) {
let a = angle -
atan2(player.cmd.sideMove, player.cmd.forwardMove);
let c = cos(a) * 20;
@@ -39,10 +49,13 @@ class Lith_AssassinPlayer : Lith_Player {
a_changeVelocity(c, s);
a_startSound("player/assassin/roll", lch_body);
m_dodgeDbc = 40;
} else if(!(player.oldButtons & BT_JUMP) && player.buttons & BT_JUMP && !player.onGround) {
m_wasHorizontalDodge = true;
} else if(!(player.oldButtons & BT_JUMP) &&
player.buttons & BT_JUMP && !player.onGround) {
vel.z = 16.0;
a_startSound("player/assassin/djump", lch_body);
m_dodgeDbc = 40;
m_wasHorizontalDodge = false;
}
}
}
@@ -51,18 +64,16 @@ class Lith_AssassinPlayer : Lith_Player {
}
}

class Lith_ItemSpriteA : Lith_ItemSprite {
class Lith_AssassinSprint : PowerSpeed {
default {
VisibleToPlayerClass "Lith_AssassinPlayer";
}
}
Powerup.Duration 2;
Speed 1.5;

class Lith_AWeapon : Lith_Weapon {
default {
Inventory.RestrictedTo "Lith_AssassinPlayer";
+POWERSPEED.NOTRAIL
}
}

#include "lzscript/5_Assassin/0_Weapon.zsc"
#include "lzscript/5_Assassin/2_DualPistols.zsc"
#include "lzscript/5_Assassin/4_BurstRifle.zsc"



+ 0
- 6
pk7/lzscript/7_Thoth/Thoth.zsc View File

@@ -16,12 +16,6 @@ class Lith_ThothPlayer : Lith_Player {
}
}

class Lith_ItemSpriteT : Lith_ItemSprite {
default {
VisibleToPlayerClass "Lith_ThothPlayer";
}
}

class Lith_TWeapon : Lith_Weapon {
default {
Inventory.RestrictedTo "Lith_ThothPlayer";


Loading…
Cancel
Save