Merge branch 'devel' into experimental
This commit is contained in:
commit
cd4c5a42c9
593 changed files with 225 additions and 26 deletions
|
|
@ -39,12 +39,90 @@ Class SawImpact : Actor
|
|||
}
|
||||
}
|
||||
|
||||
Class ChainsawAmmo : Ammo
|
||||
{
|
||||
Default
|
||||
{
|
||||
Tag "$T_CHAINSAWAMMO";
|
||||
Inventory.PickupMessage "$I_CHAINSAWAMMO";
|
||||
Inventory.Amount 20;
|
||||
Inventory.MaxAmount 100;
|
||||
Ammo.BackpackAmount 50;
|
||||
Ammo.BackpackMaxAmount 100;
|
||||
Ammo.DropAmount 20;
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
CSAM A -1;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class UTChainsaw : UTWeapon
|
||||
{
|
||||
double sawcnt;
|
||||
double ammocharge;
|
||||
|
||||
override void Tick()
|
||||
{
|
||||
Super.Tick();
|
||||
if ( !Owner ) return;
|
||||
if ( flak_sawammo )
|
||||
{
|
||||
AmmoType1 = "ChainsawAmmo";
|
||||
if ( !Ammo1 ) Ammo1 = NonIdioticAddAmmo(Owner,AmmoType1,GetDefaultByType(AmmoType1).MaxAmount);
|
||||
if ( (Owner.player.ReadyWeapon != self) || (Ammo1.Amount <= 0) )
|
||||
return;
|
||||
if ( ammocharge >= 1. )
|
||||
{
|
||||
Ammo1.Amount = max(Ammo1.Amount-int(ammocharge),0);
|
||||
ammocharge = 0.;
|
||||
}
|
||||
else ammocharge = ammocharge+1./TICRATE;
|
||||
return;
|
||||
}
|
||||
if ( Ammo1 ) Ammo1.Destroy();
|
||||
if ( AmmoType1 ) AmmoType1 = null;
|
||||
}
|
||||
|
||||
protected bool PickupForSawAmmo( Weapon ownedWeapon )
|
||||
{
|
||||
bool gotstuff = false;
|
||||
// Don't take ammo if the weapon sticks around.
|
||||
if ( !ShouldStay() )
|
||||
{
|
||||
int oldamount = 0;
|
||||
if ( ownedWeapon.Ammo1 )
|
||||
{
|
||||
oldamount = ownedWeapon.Ammo1.Amount;
|
||||
gotstuff = AddExistingAmmo(ownedWeapon.Ammo1,ownedWeapon.Ammo1.default.MaxAmount);
|
||||
}
|
||||
let Owner = ownedWeapon.Owner;
|
||||
if ( gotstuff && Owner && Owner.player )
|
||||
{
|
||||
if ( ownedWeapon.Ammo1 && !oldamount )
|
||||
PlayerPawn(Owner).CheckWeaponSwitch(ownedWeapon.Ammo1.GetClass());
|
||||
}
|
||||
}
|
||||
return gotstuff;
|
||||
}
|
||||
|
||||
override bool HandlePickup (Inventory item)
|
||||
{
|
||||
if ( item.GetClass() == GetClass() )
|
||||
{
|
||||
if ( UTChainsaw(item).PickupForSawAmmo(self) )
|
||||
item.bPickupGood = true;
|
||||
if ( MaxAmount > 1 ) return Inventory.HandlePickup(item);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
action void A_SawHit()
|
||||
{
|
||||
invoker.ammocharge += 10./TICRATE;
|
||||
A_QuakeEx(2,2,2,2,0,1,"",QF_RELATIVE,rollIntensity:0.15);
|
||||
UTMainHandler.DoSwing(self,(FRandom[Chainsaw](-1,1),FRandom[Chainsaw](-1,1)),0.6,-0.2,2,SWING_Spring);
|
||||
invoker.sawcnt += 1./TICRATE;
|
||||
|
|
@ -86,6 +164,7 @@ Class UTChainsaw : UTWeapon
|
|||
}
|
||||
action void A_SawSwipe( bool initial = false )
|
||||
{
|
||||
invoker.ammocharge += 20./TICRATE;
|
||||
A_QuakeEx(2,2,2,3,0,1,"",QF_RELATIVE,rollIntensity:0.15);
|
||||
UTMainHandler.DoSwing(self,(FRandom[Chainsaw](-1,1),FRandom[Chainsaw](-1,1)),0.6,-0.2,2,SWING_Spring);
|
||||
if ( initial ) invoker.FireEffect();
|
||||
|
|
@ -136,7 +215,11 @@ Class UTChainsaw : UTWeapon
|
|||
{
|
||||
invoker.sawcnt = 0;
|
||||
A_AlertMonsters();
|
||||
if ( bAlt ) A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE,rollIntensity:0.4);
|
||||
if ( bAlt )
|
||||
{
|
||||
invoker.ammocharge += 40./TICRATE;
|
||||
A_QuakeEx(1,1,1,3,0,1,"",QF_RELATIVE,rollIntensity:0.4);
|
||||
}
|
||||
else A_QuakeEx(0,0,0,2,0,1,"",QF_RELATIVE,rollIntensity:0.2);
|
||||
UTMainHandler.DoSwing(self,(FRandom[Chainsaw](-1,1),FRandom[Chainsaw](-1,1)),0.25,-0.1,2,SWING_Spring);
|
||||
if ( bAlt || Random[Chainsaw](0,2) ) return;
|
||||
|
|
@ -154,6 +237,21 @@ Class UTChainsaw : UTWeapon
|
|||
UTViewSmoke(s).vvel += (0,-0.2,0);
|
||||
}
|
||||
}
|
||||
action state A_SawRefire( statelabel flash = null )
|
||||
{
|
||||
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
|
||||
{
|
||||
A_ClearRefire();
|
||||
A_StopSound(CHAN_6);
|
||||
A_PlaySound("chainsaw/lower",CHAN_WEAPON);
|
||||
return ResolveState("Release");
|
||||
}
|
||||
else
|
||||
{
|
||||
A_Refire(flash);
|
||||
return ResolveState(null);
|
||||
}
|
||||
}
|
||||
Default
|
||||
{
|
||||
Tag "$T_CHAINSAW";
|
||||
|
|
@ -177,61 +275,95 @@ Class UTChainsaw : UTWeapon
|
|||
CSWS A 1 A_Raise(int.max);
|
||||
Wait;
|
||||
Ready:
|
||||
CSWS A 0
|
||||
{
|
||||
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
|
||||
A_StopSound(CHAN_WEAPON);
|
||||
}
|
||||
CSWS ABCDEFGHIJLMNO 1
|
||||
{
|
||||
A_Vibrate();
|
||||
if ( !invoker.Ammo1 || (invoker.Ammo1.Amount > 0) )
|
||||
A_Vibrate();
|
||||
A_WeaponReady(WRF_NOFIRE);
|
||||
}
|
||||
Idle:
|
||||
CSWI A 0 A_PlaySound("chainsaw/idle",CHAN_6,looping:true);
|
||||
CSWI A 0
|
||||
{
|
||||
if ( !invoker.Ammo1 || (invoker.Ammo1.Amount > 0) )
|
||||
A_PlaySound("chainsaw/idle",CHAN_6,looping:true);
|
||||
else
|
||||
return ResolveState("DryIdle");
|
||||
return ResolveState(null);
|
||||
}
|
||||
CSWI ABCDEFGHIJ 1
|
||||
{
|
||||
A_Vibrate();
|
||||
A_WeaponReady();
|
||||
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
|
||||
{
|
||||
A_StopSound(CHAN_6);
|
||||
A_PlaySound("chainsaw/lower",CHAN_WEAPON);
|
||||
return ResolveState("DryIdle");
|
||||
}
|
||||
return ResolveState(null);
|
||||
}
|
||||
Goto Idle+1;
|
||||
DryIdle:
|
||||
CSWI C 1
|
||||
{
|
||||
A_WeaponReady(WRF_NOFIRE);
|
||||
if ( !invoker.Ammo1 || (invoker.Ammo1.Amount > 0) )
|
||||
{
|
||||
A_PlaySound("chainsaw/select",CHAN_WEAPON);
|
||||
return ResolveState("Idle");
|
||||
}
|
||||
else if ( player.cmd.buttons&(BT_ATTACK|BT_ALTATTACK) )
|
||||
PlayerPawn(invoker.Owner).PickNewWeapon(null);
|
||||
return ResolveState(null);
|
||||
}
|
||||
Wait;
|
||||
Fire:
|
||||
CSWJ A 1 A_PlaySound("chainsaw/fire",CHAN_6,looping:true);
|
||||
CSWJ BCDEF 1 A_Vibrate();
|
||||
Hold:
|
||||
CSWJ G 1 A_SawHit();
|
||||
CSWJ H 0 A_Refire(1);
|
||||
CSWJ H 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ H 1 A_SawHit();
|
||||
CSWJ I 0 A_Refire(1);
|
||||
CSWJ I 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ I 1 A_SawHit();
|
||||
CSWJ J 0 A_Refire(1);
|
||||
CSWJ J 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ J 1 A_SawHit();
|
||||
CSWJ K 0 A_Refire(1);
|
||||
CSWJ K 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ K 1 A_SawHit();
|
||||
CSWJ L 0 A_Refire(1);
|
||||
CSWJ L 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ L 1 A_SawHit();
|
||||
CSWJ M 0 A_Refire(1);
|
||||
CSWJ M 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ M 1 A_SawHit();
|
||||
CSWJ N 0 A_Refire(1);
|
||||
CSWJ N 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ N 1 A_SawHit();
|
||||
CSWJ O 0 A_Refire(1);
|
||||
CSWJ O 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ O 1 A_SawHit();
|
||||
CSWJ P 0 A_Refire(1);
|
||||
CSWJ P 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ P 1 A_SawHit();
|
||||
CSWJ Q 0 A_Refire(1);
|
||||
CSWJ Q 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ Q 1 A_SawHit();
|
||||
CSWJ R 0 A_Refire(1);
|
||||
CSWJ R 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ R 1 A_SawHit();
|
||||
CSWJ S 0 A_Refire(1);
|
||||
CSWJ S 0 A_SawRefire(1);
|
||||
Goto Release;
|
||||
CSWJ S 1 A_SawHit();
|
||||
CSWJ G 0 A_Refire("Hold");
|
||||
CSWJ G 0 A_SawRefire("Hold");
|
||||
Release:
|
||||
CSWJ FEDCBA 1 A_Vibrate();
|
||||
Goto Idle;
|
||||
|
|
@ -249,14 +381,26 @@ Class UTChainsaw : UTWeapon
|
|||
}
|
||||
CSWA GHIJ 2;
|
||||
CSWA K 2 A_Vibrate(true);
|
||||
CSWA K 0 A_PlaySound("chainsaw/idle",CHAN_6,looping:true);
|
||||
CSWA K 0
|
||||
{
|
||||
if ( invoker.Ammo1 && (invoker.Ammo1.Amount <= 0) )
|
||||
{
|
||||
A_StopSound(CHAN_6);
|
||||
A_PlaySound("chainsaw/lower",CHAN_WEAPON);
|
||||
}
|
||||
else A_PlaySound("chainsaw/idle",CHAN_6,looping:true);
|
||||
}
|
||||
Goto Ready;
|
||||
AltFireSwipes:
|
||||
TNT1 A 1 A_SawSwipe(true);
|
||||
TNT1 AAAAAAAAA 1 A_SawSwipe();
|
||||
Stop;
|
||||
Deselect:
|
||||
CSWD A 0 A_PlaySound("chainsaw/lower",CHAN_6);
|
||||
CSWD A 0
|
||||
{
|
||||
if ( !invoker.Ammo1 || (invoker.Ammo1.Amount > 0) )
|
||||
A_PlaySound("chainsaw/lower",CHAN_6);
|
||||
}
|
||||
CSWD ABCDEF 1;
|
||||
CSWD F 1 A_Lower(int.max);
|
||||
Wait;
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@ Class UTBackpack : BackpackItem
|
|||
break;
|
||||
}
|
||||
}
|
||||
// sneaky fix for chainsaw ammo
|
||||
if ( (type is 'ChainsawAmmo') && flak_sawammo ) isvalid = true;
|
||||
if ( !isvalid ) continue;
|
||||
let ammoitem = Ammo(other.FindInventory(type));
|
||||
int amount = GetDefaultByType(type).BackpackAmount;
|
||||
|
|
|
|||
|
|
@ -1698,7 +1698,7 @@ Class UTMainHandler : EventHandler
|
|||
// just replace the -noflat- with a better scaled version and change the sky
|
||||
if ( !flak_doomtest )
|
||||
{
|
||||
if ( (level.GetChecksum() ~== "959A613006CC3AA912C4A22908B7566A") || (level.GetChecksum() ~== "75319AE5D2DBA214C5D394BF69DF32F4") )
|
||||
if ( (level.GetChecksum() ~== "959A613006CC3AA912C4A22908B7566A") || (level.GetChecksum() ~== "0EADB2F82732A968B8513E4DC6138439") )
|
||||
{
|
||||
Level.ReplaceTextures("-noflat-","DefTex",0);
|
||||
TextureID skytx = TexMan.CheckForTexture("BlueSky",TexMan.Type_Any);
|
||||
|
|
@ -1804,7 +1804,7 @@ Class UTMainHandler : EventHandler
|
|||
AddAmbient((3584,736,64),"testamb/slime",0.4,2.4);
|
||||
AddAmbient((3584,512,64),"testamb/lava",0.8,2.4);
|
||||
}
|
||||
else if ( level.GetChecksum() ~== "75319AE5D2DBA214C5D394BF69DF32F4" )
|
||||
else if ( level.GetChecksum() ~== "0EADB2F82732A968B8513E4DC6138439" )
|
||||
{
|
||||
TextureID deftex = TexMan.CheckForTexture("-noflat-",TexMan.Type_Any);
|
||||
TextureID skytx = TexMan.CheckForTexture("KGDaySky",TexMan.Type_Any);
|
||||
|
|
@ -1967,6 +1967,25 @@ Class UTMainHandler : EventHandler
|
|||
}
|
||||
}
|
||||
|
||||
override void WorldThingDamaged( WorldEvent e )
|
||||
{
|
||||
if ( (e.Thing.Health > 0) || e.Thing.bKilled || e.Thing.bCorpse ) return;
|
||||
if ( !e.Thing.player && !e.Thing.bIsMonster && !e.Thing.bCountKill ) return;
|
||||
if ( (e.Inflictor && e.Inflictor.player && (e.Inflictor != e.Thing)) || (e.DamageSource && e.DamageSource.player && (e.DamageSource != e.Thing)) )
|
||||
{
|
||||
Weapon saw = Weapon(e.Inflictor.FindInventory("UTChainsaw"));
|
||||
if ( !saw ) saw = Weapon(e.DamageSource.FindInventory("UTChainsaw"));
|
||||
bool current = false;
|
||||
if ( e.Inflictor.player && e.Inflictor.player.ReadyWeapon == saw ) current = true;
|
||||
if ( e.DamageSource.player && (e.DamageSource.player.ReadyWeapon == saw) ) current = true;
|
||||
if ( flak_sawammo && saw && (saw.Ammo1.Amount < 40) && !current && !Random[SawDrop](0,9) )
|
||||
{
|
||||
let a = Actor.Spawn("ChainsawAmmo",e.Thing.Vec3Offset(0,0,e.Thing.Height*.5));
|
||||
a.TossItem();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override void WorldThingDied( WorldEvent e )
|
||||
{
|
||||
if ( e.Thing.bDONTGIB ) return;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Class ViewTracer : LineTracer
|
|||
|
||||
Class UTHud : BaseStatusBar
|
||||
{
|
||||
TextureID AmmoBar, Boxes[4], Keys[5], BigNum[12], Flash, Slots[10], Icons[14], Uses[14], Man[5], Woman[5], Boss[5], WeaponBox, IconTloc2, UseTloc2, ItemBox, ItemSel, ItemFlash, ItemArrow[2], LastItem;
|
||||
TextureID AmmoBar, Boxes[4], Keys[5], BigNum[12], Flash, Slots[10], Icons[14], Uses[14], Man[5], Woman[5], Boss[5], WeaponBox, IconTloc2, UseTloc2, IconSaw2, UseSaw2, ItemBox, ItemSel, ItemFlash, ItemArrow[2], LastItem;
|
||||
Class<Weapon> IconClasses[14];
|
||||
double HScale;
|
||||
Color tintcolor, bgcolor;
|
||||
|
|
@ -150,13 +150,15 @@ Class UTHud : BaseStatusBar
|
|||
ItemFlash = TexMan.CheckForTexture("IFlash",TexMan.Type_Any);
|
||||
ItemArrow[0] = TexMan.CheckForTexture("ItmArrw1",TexMan.Type_Any);
|
||||
ItemArrow[1] = TexMan.CheckForTexture("ItmArrw2",TexMan.Type_Any);
|
||||
IconTloc2 = TexMan.CheckForTexture("IconTrn2",TexMan.Type_Any);
|
||||
UseTloc2 = TexMan.CheckForTexture("UseTrn2",TexMan.Type_Any);
|
||||
IconSaw2 = TexMan.CheckForTexture("IconSaw2",TexMan.Type_Any);
|
||||
UseSaw2 = TexMan.CheckForTexture("UseSaw2",TexMan.Type_Any);
|
||||
}
|
||||
|
||||
override void Draw( int state, double TicFrac )
|
||||
{
|
||||
Super.Draw(state,TicFrac);
|
||||
if ( IconTloc2.IsNull() ) IconTloc2 = TexMan.CheckForTexture("IconTrn2",TexMan.Type_Any);
|
||||
if ( UseTLoc2.IsNull() ) UseTloc2 = TexMan.CheckForTexture("UseTrn2",TexMan.Type_Any);
|
||||
HScale = Screen.GetWidth()/1280.;
|
||||
switch ( CVar.GetCVar('flak_colorprefs',CPlayer).GetInt() )
|
||||
{
|
||||
|
|
@ -234,14 +236,18 @@ Class UTHud : BaseStatusBar
|
|||
if ( !(w is IconClasses[i]) ) continue;
|
||||
if ( use )
|
||||
{
|
||||
if ( (i == 11) && flak_transloc2k4 )
|
||||
if ( (i == 10) && flak_sawammo )
|
||||
UTDrawTintedTex(UseSaw2,sx,opacity+7);
|
||||
else if ( (i == 11) && flak_transloc2k4 )
|
||||
UTDrawTintedTex(UseTloc2,sx,opacity+7);
|
||||
else UTDrawTintedTex(Uses[i],sx,opacity+7);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (i == 11) && flak_transloc2k4 )
|
||||
UTDrawTintedTex(IconTloc2,sx,opacity+7);
|
||||
if ( (i == 10) && flak_sawammo )
|
||||
UTDrawTintedTex(IconSaw2,sx,opacity,halftint);
|
||||
else if ( (i == 11) && flak_transloc2k4 )
|
||||
UTDrawTintedTex(IconTloc2,sx,opacity,halftint);
|
||||
else UTDrawTintedTex(Icons[i],sx,opacity,halftint);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue