Skip to content

Commit

Permalink
Pull in Viper's Quick Swap logic
Browse files Browse the repository at this point in the history
  • Loading branch information
UndeadZeratul committed Jul 18, 2023
1 parent 1b9dac7 commit c9c9d37
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 15 deletions.
14 changes: 7 additions & 7 deletions TEXTURES.majestic
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Texture definitions generated by SLADE3
// on Mon Jul 17 21:15:06 2023
// on Tue Jul 18 07:52:17 2023

Sprite "MJMGA0", 15, 10
{
Expand Down Expand Up @@ -105,23 +105,23 @@ Sprite "MJCGD0", 89, 119
Patch "MJCGD0", 0, 0
}

Sprite "MJCFA0", 110, 156
Sprite "MJCGE0", 110, 156
{
XScale 1.200
YScale 1.400
Offset -144, -91
Patch "MJCFA0", 0, 0
}

Sprite "MJCFB0", 89, 119
Sprite "MJCGF0", 89, 119
{
XScale 1.100
YScale 1.400
Offset -149, -131
Patch "MJCGA0", 0, 0
}

Sprite "MJCFC0", 89, 119
Sprite "MJCGG0", 89, 119
{
XScale 1.200
YScale 1.400
Expand Down Expand Up @@ -173,7 +173,7 @@ Sprite "MJ2GD0", 89, 119
}
}

Sprite "MJ2FA0", 110, 156
Sprite "MJ2GE0", 110, 156
{
XScale 1.200
YScale 1.400
Expand All @@ -184,7 +184,7 @@ Sprite "MJ2FA0", 110, 156
}
}

Sprite "MJ2FB0", 89, 119
Sprite "MJ2GF0", 89, 119
{
XScale 1.100
YScale 1.400
Expand All @@ -195,7 +195,7 @@ Sprite "MJ2FB0", 89, 119
}
}

Sprite "MJ2FC0", 89, 119
Sprite "MJ2GG0", 89, 119
{
XScale 1.200
YScale 1.400
Expand Down
91 changes: 83 additions & 8 deletions zscript/accensus/weapons/Majestic/majestic.zs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,13 @@ class HDMajestic : HDHandgun
}
}

action void A_CheckMajesticHand()
{
bool right = !invoker.wronghand;
right = right && Wads.CheckNumForName("id", 0) != -1 || !right && Wads.CheckNumForName("id", 0) == -1;
player.GetPSprite(PSP_WEAPON).sprite = GetSpriteIndex(right ? "MJCGA0" : "MJ2GA0");
}

const MaxCharge = 60;
const Tiers = 3;
private int Charge;
Expand Down Expand Up @@ -254,6 +261,7 @@ class HDMajestic : HDHandgun
Ready:
MJCG # 1
{
A_CheckMajesticHand();
A_WeaponReady(WRF_NOFIRE | (invoker.Charge == 0 ? WRF_ALL : 0));

if (PressingFire() && invoker.WeaponStatus[MJProp_Mag] > 0 || invoker.Charge > 0 && player.GetPSprite(PSP_WEAPON).frame == 1)
Expand Down Expand Up @@ -311,10 +319,12 @@ class HDMajestic : HDHandgun
}
Goto ReadyEnd;
Select0:
MJCG A 1 A_CheckMajesticFrame();
MJCG A 0 A_CheckMajesticHand();
#### A 1 A_CheckMajesticFrame();
Goto Select0Small;
Deselect0:
MJCG A 1
MJCG A 0 A_CheckMajesticHand();
#### A 1
{
invoker.MustCancel = false;
A_CheckMajesticFrame();
Expand All @@ -326,15 +336,15 @@ class HDMajestic : HDHandgun
Goto Ready;

Fire:
MJCG B 1;
MJCG A 1
#### B 1;
#### A 1
{
HDPlayerPawn(self).gunbraced = false;
}
MJCF A 1 Bright A_FireMajestic(false);
MJCF B 1;
MJCF C 1;
MJCG A 2 A_CheckMajesticFrame();
#### E 1 Bright A_FireMajestic(false);
#### F 1;
#### G 1;
#### A 2 A_CheckMajesticFrame();
Goto Ready;

Reload:
Expand Down Expand Up @@ -449,6 +459,71 @@ class HDMajestic : HDHandgun
#### # 1 Offset(2, 38);
#### # 1 Offset(1, 34);
Goto Nope;


Firemode:
SwapPistols:
#### A 0 A_SwapHandguns();
#### A 0 A_JumpIf(player.GetPSprite(PSP_WEAPON).sprite == GetSpriteIndex("MJCGA0"), "SwapPistols2");
SwapPistols1:
TNT1 A 0 A_Overlay(1026, "lowerleft");
TNT1 A 0 A_Overlay(1025, "raiseright");
TNT1 A 5;
MJCG A 0;
Goto Nope;
SwapPistols2:
TNT1 A 0 A_Overlay(1026, "lowerright");
TNT1 A 0 A_Overlay(1025, "raiseleft");
TNT1 A 5;
MJ2G A 0;
Goto Nope;
LowerLeft:
MJCG # 0 A_WeaponBusy(true);
#### # 1 Offset(-6, 38);
#### # 1 Offset(-12, 48);
#### # 1 Offset(-20, 60);
#### # 1 Offset(-34, 76);
#### # 1 Offset(-50, 86);
stop;
LowerRight:
MJ2G # 0 A_WeaponBusy(true);
#### # 1 Offset(6, 38);
#### # 1 Offset(12, 48);
#### # 1 Offset(20, 60);
#### # 1 Offset(34, 76);
#### # 1 Offset(50, 86);
Stop;
RaiseLeft:
MJCG # 0 A_WeaponBusy(false);
#### # 1 Offset(-50, 86);
#### # 1 Offset(-34, 76);
#### # 1 Offset(-20, 60);
#### # 1 Offset(-12, 48);
#### # 1 Offset(-6, 38);
Stop;
RaiseRight:
MJ2G # 0 A_WeaponBusy(false);
#### # 1 Offset(50, 86);
#### # 1 Offset(34, 76);
#### # 1 Offset(20, 60);
#### # 1 Offset(12, 48);
#### # 1 Offset(6, 38);
Stop;
WhyAreYouSmiling:
#### A 0 A_WeaponBusy(true);
#### # 1 Offset(0, 48);
#### # 1 Offset(0, 60);
#### # 1 Offset(0, 76);
TNT1 A 7;
TNT1 A 0
{
invoker.wronghand = !invoker.wronghand;
A_CheckMajesticHand();
}
#### # 1 Offset(0, 76);
#### # 1 Offset(0, 60);
#### # 1 Offset(0, 48);
Goto Nope;
}
}

Expand Down

0 comments on commit c9c9d37

Please sign in to comment.