Code: Select all
ACTOR QuickKickQ: CustomInventory
{
States
{
Use:
KICK A 0 A_Overlay(-2, Kick)
Stop
Kick:
KICK A 2
KICK B 3 A_Punch
KICK C 2
Stop
}
}
Moderator: GZDoom Developers
Code: Select all
ACTOR QuickKickQ: CustomInventory
{
States
{
Use:
KICK A 0 A_Overlay(-2, Kick)
Stop
Kick:
KICK A 2
KICK B 3 A_Punch
KICK C 2
Stop
}
}
Code: Select all
class shoulderGun : wosPickup {
action void W_FireShoulderGun(bool useAmmo, bool doAlertMonsters) {
if (player == null) {
return;
}
player.mo.PlayAttacking2 ();
let ownr2 = binderPlayer(invoker.owner);
if (useAmmo) {
ownr2.takeInventory("magazine_shoulderGun", 1);
}
// shoot action z blasterStaff lvl.2 altFire /////////////////////////
A_StartSound("weapons/shoulderGun/loop", CHAN_6, CHANF_DEFAULT, 1.0, false);
//A_GunFlash();
A_FireProjectile("greenArcLightning", 0.1*random(20,-20), false, -10, 20, 0, 0);
A_SpawnItemEx("redFlashShort", 8, 0, 16, 0);
if (doAlertMonsters) {
A_AlertMonsters();
}
A_OverlayOffset(6, random(-2,2), random(-2,2), WOF_INTERPOLATE); //vypnout, protoze trese i hlavni zbrani
////////////////////////////////////////////////////////////////////////
}
Default {
//$Category "Powerups/WoS"
//$Title "ShoulderGun"
+INVENTORY.INVBAR
+INVENTORY.KEEPDEPLETED
+INVENTORY.UNDROPPABLE
+INVENTORY.UNTOSSABLE
Tag "$TAG_shoulderGun";
Inventory.Icon "I_SHCN";
Inventory.Amount 1;
Inventory.MaxAmount 1;
Inventory.InterhubAmount 1;
Inventory.PickupMessage "$PICKUP_shoulderGun";
Decal "BulletChip";
Mass shoulderGunWeight;
}
States {
Spawn:
DUMM A -1;
Stop;
Use:
TNT1 A 0 {
if ( GetPlayerInput(MODINPUT_BUTTONS)&BT_USE ) { return resolveState("UseCheck"); }
else if ( GetPlayerInput(MODINPUT_BUTTONS)&BT_USER1 && CountInv("shoulderGunCharger") && CountInv("magazine_shoulderGun") != 32 ) { return resolveState("UseReload"); }
else { return resolveState("UseYes"); }
}
Fail;
UseCheck:
TNT1 A 0 A_Log(String.Format("\c[yellow][ %i%s", CountInv("magazine_shoulderGun"), "\c[yellow] pts ShoulderGun battery left ]"));
Fail;
UseReload:
TNT1 A 0 {
let item = self.FindInventory("shoulderGunCharger");
if ( item != null ) {
useInventory(item);
} else {
A_Log("\c[red][ You need ShoulderGun charger to reload your ShoulderGun! ]");
}
}
Fail;
UseYes:
TNT1 A 0 {
statelabel nextstate = "remove";
let ownr = binderPlayer(invoker.owner);
if (ownr && ownr.countInv("magazine_shoulderGun") > 0 ) {
nextstate = "startoverlay";
}
else {
A_Log("\c[red][ Not enough cells! ]");
A_ClearOverlays(6, 6);
return ResolveState("remove");
}
return resolvestate(nextstate);
}
Fail;
startoverlay:
TNT1 A 0 {
int layer = 6;
A_OverLay(layer,"shootShoulderGun");
}
wait;
shootShoulderGun:
// animation remade with new model //////////////////////////////////////////
DUMA ABCDEFGHIJ 1;
DUMF AA 1;
DUMF A 2;
DUMF B 2 Bright W_FireShoulderGun(true, true);
DUMF C 2 Bright W_FireShoulderGun(false, false);
DUMF B 2 Bright W_FireShoulderGun(false, false);
DUMF C 2 Bright W_FireShoulderGun(false, false);
DUMF B 2 Bright W_FireShoulderGun(false, false);
DUMF C 2 Bright W_FireShoulderGun(false, true);
DUMA J 3;
DUMA J 4 A_StartSound("weapons/shoulderGun/stop",6); //zrusit zvuk blesku
DUMA J 5;
DUMA J 3;
DUMA J 3;
DUMA JIH 4;
DUMA GFEDCBA 1;
TNT1 A 0 {
return resolveState("remove");
}
/////////////////////////////////////////////////////////////////////////////
/*SHCH JIHGFEDCBA 1;
SHCH AA 1;
//SHCN A 1 A_StartSound("weapons/shoulderGun/fire", CHAN_7, CHANF_DEFAULT, 1.0, false);
SHCN A 2;
SHCN I 2 Bright W_FireShoulderGun(true, true);
SHCN J 2 Bright W_FireShoulderGun(false, false);
SHCN I 2 Bright W_FireShoulderGun(false, false);
SHCN J 2 Bright W_FireShoulderGun(false, false);
SHCN I 2 Bright W_FireShoulderGun(false, false);
SHCN J 2 Bright W_FireShoulderGun(false, true);
SHCN B 3;
SHCN C 3;
SHCN D 4 A_StartSound("weapons/shoulderGun/stop",6); //zrusit zvuk blesku
SHCN E 5;
SHCN F 4;
SHCN G 4;
SHCN H 3;
SHCN A 3;
SHCH ABCDEFGHIJ 1;
TNT1 A 0 {
return resolveState("remove");
}*/
remove:
TNT1 A 0 {
A_ClearOverlays(6, 6);
}
Fail;
}
}
Code: Select all
ACTOR QuickKickQ : CustomInventory
{
States
{
Pickup:
TNT1 A 0 A_RailWait() //Required function to give the item to the inventory
Stop
Use:
TNT1 A 0 A_Overlay(-2, "Kick", FALSE)
Fail //Required to use Fail instead of Stop to prevent the item from being removed
Kick:
KICK A 2
KICK B 3 A_Punch
KICK C 2
Stop
}
}