Small scorenum/damnum refactor.
This commit is contained in:
parent
6d8732af5d
commit
38cd7df826
23 changed files with 182 additions and 54 deletions
|
|
@ -20,9 +20,9 @@ extend Class SWWMHandler
|
|||
Console.Printf("\cyLOADSAMONEY!\c-");
|
||||
S_StartSound("menu/buyinv",CHAN_ITEM,CHANF_UI);
|
||||
S_StartSound("misc/emone",CHAN_VOICE,CHANF_UI);
|
||||
SWWMScoreObj.SpawnAtActorFromHandler(self,999999999,players[e.Args[0]].mo);
|
||||
}
|
||||
SWWMCredits.Give(players[e.Args[0]],999999999);
|
||||
SWWMScoreObj.SpawnFromHandler(self,999999999,players[e.Args[0]].mo.Vec3Offset(0,0,players[e.Args[0]].mo.Height/2));
|
||||
}
|
||||
else if ( e.Name ~== "swwmlorecheat" )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ extend Class SWWMHandler
|
|||
// damage numbers, combat tracking, etc.
|
||||
private void DoDamageHandling( WorldEvent e )
|
||||
{
|
||||
SWWMDamNum.SpawnFromHandler(self,e.Damage,level.Vec3Offset(e.Thing.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,e.Thing.Height/2)),e.DamageType);
|
||||
SWWMDamNum.SpawnAtActorFromHandler(self,e.Damage,e.Thing,e.DamageType);
|
||||
// combat tracker updates if either an ally of the player is hit, or an ally hit this enemy
|
||||
// (this automatically also does the same for the player itself, of course)
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
|
|
@ -243,7 +243,7 @@ extend Class SWWMHandler
|
|||
}
|
||||
SWWMScoreObj scr = null;
|
||||
if ( src.player == players[consoleplayer] )
|
||||
scr = SWWMScoreObj.SpawnFromHandler(self,score,e.Thing.Vec3Offset(0,0,e.Thing.Height/2));
|
||||
scr = SWWMScoreObj.SpawnAtActorFromHandler(self,score,e.Thing);
|
||||
int ofs = 0;
|
||||
if ( e.DamageType == 'Push' )
|
||||
{
|
||||
|
|
@ -304,9 +304,12 @@ extend Class SWWMHandler
|
|||
{
|
||||
allkills = true;
|
||||
SWWMCredits.Give(src.player,1000);
|
||||
if ( src.player == players[consoleplayer] ) Console.Printf(StringTable.Localize("$SWWM_LASTMONSTER"),1000);
|
||||
if ( src.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorFromHandler(self,1000,src);
|
||||
Console.Printf(StringTable.Localize("$SWWM_LASTMONSTER"),1000);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize("$SWWM_LASTMONSTERREM"),src.player.GetUserName(),1000);
|
||||
SWWMScoreObj.SpawnFromHandler(self,1000,src.Vec3Offset(0,0,src.Height/2));
|
||||
SWWMUtility.AchievementProgressInc("allkills",1,src.player);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ extend Class SWWMHandler
|
|||
SWWMUtility.AchievementProgressInc("allitems",1,players[i]);
|
||||
}
|
||||
SWWMCredits.Give(players[i],score);
|
||||
SWWMScoreObj.SpawnFromHandler(self,score,players[i].mo.Vec3Offset(0,0,players[i].mo.Height/2));
|
||||
if ( i == consoleplayer ) SWWMScoreObj.SpawnAtActorFromHandler(self,score,players[i].mo);
|
||||
lastitemcount[i] = players[i].itemcount;
|
||||
let s = SWWMStats.Find(players[i]);
|
||||
s.items++;
|
||||
|
|
@ -209,12 +209,12 @@ extend Class SWWMHandler
|
|||
if ( mapclearagain )
|
||||
{
|
||||
SWWMCredits.Give(players[i],500);
|
||||
SWWMScoreObj.SpawnFromHandler(self,500,players[i].mo.Vec3Offset(0,0,players[i].mo.Height/2));
|
||||
if ( i == consoleplayer ) SWWMScoreObj.SpawnAtActorFromHandler(self,500,players[i].mo);
|
||||
}
|
||||
else
|
||||
{
|
||||
SWWMCredits.Give(players[i],5000);
|
||||
SWWMScoreObj.SpawnFromHandler(self,5000,players[i].mo.Vec3Offset(0,0,players[i].mo.Height/2));
|
||||
if ( i == consoleplayer ) SWWMScoreObj.SpawnAtActorFromHandler(self,5000,players[i].mo);
|
||||
}
|
||||
}
|
||||
mapclearagain++;
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ extend Class SWWMStatusBar
|
|||
for ( double alph = .1; alph <= .5; alph += .1 )
|
||||
{
|
||||
tst = "AAA";
|
||||
SWWMUtility.ObscureText(tst,(gametic-trl)/3,true);
|
||||
SWWMUtility.ObscureText(tst,(gametic-trl)/3,minihud:true);
|
||||
trl--;
|
||||
Screen.DrawText(MiniHUDFont,mhudfontcol[MCR_WHITE],xmargin+107+ox,ss.y-(ymargin+20+oy),tst,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,falph*alph,DTA_LegacyRenderStyle,STYLE_Add);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,26 @@ Class SWWMScoreObj play
|
|||
int starttic, seed, seed2;
|
||||
SWWMScoreObj next;
|
||||
|
||||
// all of these variations are here to simplify code
|
||||
|
||||
static SWWMScoreObj SpawnAtActorBunch( int score, Actor a, int tcolor = -1 )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
if ( !hnd ) return null;
|
||||
Vector3 pos = level.Vec3Offset(a.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,a.Height/2));
|
||||
return SpawnFromHandler(hnd,score,pos,tcolor);
|
||||
}
|
||||
|
||||
static SWWMScoreObj SpawnAtActor( int score, Actor a, int tcolor = -1 )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
if ( !hnd ) return null;
|
||||
Vector3 pos = a.Vec3Offset(0,0,a.Height/2);
|
||||
return SpawnFromHandler(hnd,score,pos,tcolor);
|
||||
}
|
||||
|
||||
static SWWMScoreObj Spawn( int score, Vector3 pos, int tcolor = -1 )
|
||||
{
|
||||
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
|
|
@ -21,6 +41,20 @@ Class SWWMScoreObj play
|
|||
return SpawnFromHandler(hnd,score,pos,tcolor);
|
||||
}
|
||||
|
||||
static SWWMScoreObj SpawnAtActorBunchFromHandler( SWWMHandler hnd, int score, Actor a, int tcolor = -1 )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
Vector3 pos = level.Vec3Offset(a.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,a.Height/2));
|
||||
return SpawnFromHandler(hnd,score,pos,tcolor);
|
||||
}
|
||||
|
||||
static SWWMScoreObj SpawnAtActorFromHandler( SWWMHandler hnd, int score, Actor a, int tcolor = -1 )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
Vector3 pos = a.Vec3Offset(0,0,a.Height/2);
|
||||
return SpawnFromHandler(hnd,score,pos,tcolor);
|
||||
}
|
||||
|
||||
static SWWMScoreObj SpawnFromHandler( SWWMHandler hnd, int score, Vector3 pos, int tcolor = -1 )
|
||||
{
|
||||
let o = new("SWWMScoreObj");
|
||||
|
|
@ -51,7 +85,7 @@ Class SWWMScoreObj play
|
|||
}
|
||||
}
|
||||
|
||||
// damage/health/armor numbers
|
||||
// damage numbers
|
||||
Class SWWMDamNum play
|
||||
{
|
||||
int tcolor;
|
||||
|
|
@ -61,6 +95,17 @@ Class SWWMDamNum play
|
|||
int starttic, seed, seed2;
|
||||
SWWMDamNum next;
|
||||
|
||||
// damage numbers always spawn in bunches, so no need for that function variant
|
||||
|
||||
static SWWMDamNum SpawnAtActor( int damage, Actor a, Name type = '' )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
if ( !hnd ) return null;
|
||||
Vector3 pos = level.Vec3Offset(a.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,a.Height/2));
|
||||
return SpawnFromHandler(hnd,damage,pos,type);
|
||||
}
|
||||
|
||||
static SWWMDamNum Spawn( int damage, Vector3 pos, Name type = '' )
|
||||
{
|
||||
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
|
||||
|
|
@ -68,6 +113,13 @@ Class SWWMDamNum play
|
|||
return SpawnFromHandler(hnd,damage,pos,type);
|
||||
}
|
||||
|
||||
static SWWMDamNum SpawnAtActorFromHandler( SWWMHandler hnd, int damage, Actor a, Name type = '' )
|
||||
{
|
||||
if ( !a ) return null;
|
||||
Vector3 pos = level.Vec3Offset(a.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,a.Height/2));
|
||||
return SpawnFromHandler(hnd,damage,pos,type);
|
||||
}
|
||||
|
||||
static SWWMDamNum SpawnFromHandler( SWWMHandler hnd, int damage, Vector3 pos, Name type = '' )
|
||||
{
|
||||
let o = new("SWWMDamNum");
|
||||
|
|
|
|||
|
|
@ -25,16 +25,16 @@ Class ArmorNuggetItem : SWWMSpareArmor
|
|||
SWWMLoreLibrary.Add(Owner.player,"Nugget");
|
||||
bool bUsed = Super.Use(pickup);
|
||||
// sell excess
|
||||
if ( !bUsed )
|
||||
if ( !bUsed && Owner.player )
|
||||
{
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
return bUsed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,8 @@ Class SWWMArmor : Armor abstract
|
|||
while ( (amount <= (MaxAmount-default.Amount)) && (Owner.CountInv(parent) > 0) )
|
||||
{
|
||||
Amount += default.Amount;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(default.Amount,Owner,Font.CR_GREEN);
|
||||
Owner.TakeInventory(parent,1);
|
||||
// absorb the extra damage too
|
||||
saved = HandleDamage(damage,damageType,flags);
|
||||
|
|
@ -168,6 +170,8 @@ Class SWWMSpareArmor : Inventory abstract
|
|||
}
|
||||
Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount);
|
||||
SWWMHandler.ArmorFlash(Owner.PlayerNumber());
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_GREEN);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ Class SWWMHealth : Inventory abstract
|
|||
}
|
||||
SWWMHandler.HealthFlash(Owner.PlayerNumber());
|
||||
Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_BLUE);
|
||||
AutoUseExtra(false);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -141,6 +143,8 @@ Class SWWMHealth : Inventory abstract
|
|||
while ( (Amount > 0) && (newdamage > 0) )
|
||||
{
|
||||
newdamage = newdamage-GetDefaultByType(giveme).Amount;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(GetDefaultByType(giveme).Amount,Owner,Font.CR_BLUE);
|
||||
if ( newdamage < 0 ) Owner.GiveBody(-newdamage,GetDefaultByType(giveme).MaxAmount);
|
||||
newdamage = max(0,newdamage);
|
||||
if ( !morethanonce ) SWWMHandler.HealthFlash(Owner.PlayerNumber());
|
||||
|
|
|
|||
|
|
@ -15,14 +15,18 @@ Mixin Class SWWMAutoUseFix
|
|||
// sell excess if there's a price
|
||||
if ( !deathmatch && bALWAYSPICKUP && (Amount+item.Amount > MaxAmount) && (Stamina != 0) )
|
||||
{
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
item.bPickupGood = true;
|
||||
}
|
||||
}
|
||||
return Super.HandlePickup(item);
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ Class SWWMCollectible : Inventory abstract
|
|||
// give credit
|
||||
if ( other.player && (Stamina > 0) )
|
||||
{
|
||||
SWWMScoreObj.Spawn(Stamina,level.Vec3Offset(other.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,other.Height/2)));
|
||||
if ( other.player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(Stamina,other);
|
||||
SWWMCredits.Give(other.player,Stamina);
|
||||
}
|
||||
// send to all other players
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ Class RefresherRegen : Powerup
|
|||
if ( !Owner || (Owner.health <= 0) || ((EffectTics-5)%175) ) return;
|
||||
if ( !Owner.GiveBody(int(Strength),500) ) return;
|
||||
SWWMHandler.DoFlash(Owner,Color(32,224,128,255),10);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(int(Strength),Owner,Font.CR_BLUE);
|
||||
Owner.A_StartSound("powerup/refresher",CHAN_ITEMEXTRA,CHANF_LOCAL|CHANF_OVERLAP,.4);
|
||||
if ( Owner is 'Demolitionist' )
|
||||
Demolitionist(Owner).lastbump *= 0.99;
|
||||
|
|
@ -70,16 +72,16 @@ Class HealthNuggetItem : SWWMHealth
|
|||
SWWMLoreLibrary.Add(Owner.player,"Nugget");
|
||||
bool bUsed = Super.Use(pickup);
|
||||
// sell excess
|
||||
if ( !bUsed )
|
||||
if ( !bUsed && Owner.player )
|
||||
{
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(self)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
return bUsed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -529,12 +529,15 @@ Class SWWMLamp : Inventory
|
|||
if ( (Charge >= Default.Charge) && (Amount+item.Amount > MaxAmount) )
|
||||
{
|
||||
// sell excess
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
int sellprice = abs(Stamina)/2;
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,17 +43,34 @@ Class GrilledCheeseSandwich : Inventory
|
|||
SWWMHandler.DoFlash(Owner,Color(64,255,255,64),10);
|
||||
Owner.A_QuakeEx(9.,9.,9.,3,0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.);
|
||||
Owner.GiveBody(1000,1000);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(1000,Owner,Font.CR_BLUE);
|
||||
if ( Owner is 'Demolitionist' )
|
||||
{
|
||||
let n = Owner.FindInventory("ArmorNugget");
|
||||
if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount);
|
||||
else n.Amount = n.MaxAmount;
|
||||
else
|
||||
{
|
||||
n.Amount = n.MaxAmount;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(n.MaxAmount,Owner,Font.CR_GREEN);
|
||||
}
|
||||
let b = Owner.FindInventory("BlastSuit");
|
||||
if ( !b ) Owner.GiveInventory("BlastSuit",GetDefaultByType("BlastSuit").MaxAmount);
|
||||
else b.Amount = b.MaxAmount;
|
||||
else
|
||||
{
|
||||
b.Amount = b.MaxAmount;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(b.MaxAmount,Owner,Font.CR_GREEN);
|
||||
}
|
||||
let w = Owner.FindInventory("WarArmor");
|
||||
if ( !w ) Owner.GiveInventory("WarArmor",GetDefaultByType("WarArmor").MaxAmount);
|
||||
else w.Amount = w.MaxAmount;
|
||||
else
|
||||
{
|
||||
w.Amount = w.MaxAmount;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(w.MaxAmount,Owner,Font.CR_GREEN);
|
||||
}
|
||||
SWWMLoreLibrary.Add(Owner.player,"Nugget");
|
||||
SWWMLoreLibrary.Add(Owner.player,"BlastSuit");
|
||||
SWWMLoreLibrary.Add(Owner.player,"WarArmor");
|
||||
|
|
@ -1044,8 +1061,12 @@ Class RagekitPower : Powerup
|
|||
SWWMHandler.DoFlash(Owner,Color(16,255,0,0),5);
|
||||
Owner.GiveBody(1,100);
|
||||
Owner.A_AlertMonsters(swwm_uncapalert?0:2000);
|
||||
if ( (Owner.player == players[consoleplayer]) && (gametic > lastrage) && (swwm_mutevoice < 2) )
|
||||
lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+20;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(1,Owner,Font.CR_BLUE);
|
||||
if ( (gametic > lastrage) && (swwm_mutevoice < 2) )
|
||||
lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+20;
|
||||
}
|
||||
Owner.A_QuakeEx(1.5,1.5,1.5,Random[Rage](1,2),0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:.5);
|
||||
lastpulse = max(lastpulse,gametic+10);
|
||||
Demolitionist(Owner).lastbump *= .995;
|
||||
|
|
@ -1078,8 +1099,12 @@ Class RagekitPower : Powerup
|
|||
Owner.A_AlertMonsters(swwm_uncapalert?0:5000);
|
||||
SWWMHandler.DoFlash(Owner,Color(64,255,0,0),10);
|
||||
Owner.A_QuakeEx(8.,8.,8.,Random[Rage](3,8),0,1,"",QF_RELATIVE|QF_SCALEDOWN|QF_3D,rollIntensity:1.);
|
||||
if ( (Owner.player == players[consoleplayer]) && (gametic > lastrage) && (swwm_mutevoice < 2) )
|
||||
lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+40;
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(5,Owner,Font.CR_BLUE);
|
||||
if ( (gametic > lastrage) && (swwm_mutevoice < 2) )
|
||||
lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+40;
|
||||
}
|
||||
Owner.A_StartSound("powerup/ragekithit",CHAN_POWERUP,CHANF_OVERLAP);
|
||||
lasteffect = level.maptime;
|
||||
lastpulse = max(lastpulse,gametic+35);
|
||||
|
|
@ -1120,6 +1145,8 @@ Class Ragekit : Inventory
|
|||
if ( pickup && !deathmatch ) return false;
|
||||
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
|
||||
Owner.GiveBody(100,100);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(100,Owner,Font.CR_BLUE);
|
||||
SWWMUtility.AchievementProgressInc("rage",1,Owner.player);
|
||||
if ( !(Owner is 'Demolitionist') )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1172,6 +1172,8 @@ Class DivineSpriteEffect : Inventory
|
|||
{
|
||||
healcnt = 0;
|
||||
Owner.GiveBody(1000,1000);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(1000,Owner,Font.CR_BLUE);
|
||||
SWWMHandler.DoFlash(Owner,Color(40,255,255,255),20);
|
||||
if ( Owner is 'Demolitionist' )
|
||||
Demolitionist(Owner).lastbump *= 0.97;
|
||||
|
|
@ -1180,6 +1182,8 @@ Class DivineSpriteEffect : Inventory
|
|||
else if ( !(healcnt%5) )
|
||||
{
|
||||
Owner.GiveBody(500,10000);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(500,Owner,Font.CR_BLUE);
|
||||
Owner.A_StartSound("powerup/divinehit",CHAN_ITEMEXTRA,CHANF_OVERLAP);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ Class Demolitionist : PlayerPawn
|
|||
}
|
||||
else Console.Printf(StringTable.Localize("$SWWM_FINDSECRETREM"),player.GetUserName(),score);
|
||||
SWWMCredits.Give(player,score);
|
||||
SWWMScoreObj.Spawn(score,Vec3Offset(0,0,Height/2));
|
||||
if ( player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(score,self);
|
||||
// somehow ongivesecret can be called BEFORE PostBeginPlay (wat)
|
||||
if ( !mystats ) mystats = SWWMStats.Find(player);
|
||||
mystats.secrets++;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ extend Class Demolitionist
|
|||
void CheatGive_Health( int amount = 0 )
|
||||
{
|
||||
player.health = health = (amount>0)?(health+amount):default.health;
|
||||
if ( player == players[consoleplayer] && ((amount > 0) || ((health-default.health) > 0)) )
|
||||
SWWMScoreObj.SpawnAtActorBunch((amount>0)?amount:(health-default.health),self,Font.CR_BLUE);
|
||||
}
|
||||
void CheatGive_Backpack()
|
||||
{
|
||||
|
|
@ -60,6 +62,8 @@ extend Class Demolitionist
|
|||
armo.AttachToOwner(self);
|
||||
}
|
||||
armo.Amount = armo.MaxAmount;
|
||||
if ( player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(armo.MaxAmount,self,Font.CR_GREEN);
|
||||
}
|
||||
}
|
||||
void CheatGive_Keys()
|
||||
|
|
@ -225,6 +229,7 @@ extend Class Demolitionist
|
|||
|
||||
void CheatTake_Health( int amount = 0 )
|
||||
{
|
||||
if ( amount > 0 ) SWWMDamNum.SpawnAtActor(amount,self);
|
||||
if ( amount >= health )
|
||||
{
|
||||
CheatSuicide();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ extend Class Demolitionist
|
|||
if ( player == players[consoleplayer] ) Console.Printf(StringTable.Localize("$SWWM_FINDKEY"),item.GetTag(),score);
|
||||
else Console.Printf(StringTable.Localize("$SWWM_FINDKEYREM"),player.GetUserName(),item.GetTag(),score);
|
||||
SWWMCredits.Give(player,score);
|
||||
SWWMScoreObj.Spawn(100,player.mo.Vec3Offset(0,0,Height/2));
|
||||
if ( player == players[consoleplayer] ) SWWMScoreObj.SpawnAtActorBunch(100,self);
|
||||
if ( !ingivecheat )
|
||||
{
|
||||
if ( !Random[DemoLines](0,5) &&
|
||||
|
|
|
|||
|
|
@ -316,6 +316,8 @@ extend Class Demolitionist
|
|||
if ( hasrevived ) SWWMUtility.MarkAchievement("sekiro",player);
|
||||
hasrevived = true;
|
||||
player.Resurrect();
|
||||
if ( player == players[consoleplayer] )
|
||||
SWWMScoreObj.SpawnAtActorBunch(player.health,self,Font.CR_BLUE);
|
||||
player.damagecount = 0;
|
||||
player.bonuscount = 0;
|
||||
player.poisoncount = 0;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ extend Class SWWMUtility
|
|||
return str;
|
||||
}
|
||||
|
||||
static void ObscureText( out String str, int seed, bool alnum = false )
|
||||
static void ObscureText( out String str, int seed, bool alnum = false, bool minihud = false )
|
||||
{
|
||||
int len = str.CodePointCount();
|
||||
String newstr = "";
|
||||
|
|
@ -96,10 +96,19 @@ extend Class SWWMUtility
|
|||
newstr.AppendCharacter(ch);
|
||||
else if ( alnum )
|
||||
{
|
||||
// only uppercase letters and numbers
|
||||
int sd = abs(seed%36);
|
||||
if ( sd >= 10 ) sd += 7;
|
||||
newstr.AppendCharacter(sd+48);
|
||||
}
|
||||
else if ( minihud )
|
||||
{
|
||||
// exclude forward/backward slashes as they're wider
|
||||
int sd = abs(seed%93);
|
||||
if ( sd >= 15 ) sd++;
|
||||
if ( sd >= 60 ) sd++;
|
||||
newstr.AppendCharacter(sd+32);
|
||||
}
|
||||
else newstr.AppendCharacter((abs(seed)%95)+32);
|
||||
}
|
||||
str = newstr;
|
||||
|
|
|
|||
|
|
@ -336,12 +336,15 @@ Class SWWMWeapon : Weapon abstract
|
|||
if ( !deathmatch && (Amount+item.Amount > MaxAmount) && (item.Stamina != 0) )
|
||||
{
|
||||
// sell excess
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
item.bPickupGood = true;
|
||||
|
|
|
|||
|
|
@ -27,12 +27,15 @@ Class ExplodiumGun : SWWMWeapon
|
|||
if ( !deathmatch && (Amount+item.Amount > MaxAmount) && (item.Stamina != 0) )
|
||||
{
|
||||
// sell excess
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
item.bPickupGood = true;
|
||||
|
|
@ -55,7 +58,7 @@ Class ExplodiumGun : SWWMWeapon
|
|||
DualExplodiumGun(SisterWeapon).clipcount = DualExplodiumGun(SisterWeapon).default.clipcount;
|
||||
}
|
||||
// autoswitch if enabled
|
||||
if ( !Owner.player.GetNeverSwitch() )
|
||||
if ( Owner.player && !Owner.player.GetNeverSwitch() )
|
||||
Owner.player.PendingWeapon = SisterWeapon;
|
||||
// add the oneliner
|
||||
let demo = Demolitionist(Owner);
|
||||
|
|
|
|||
|
|
@ -25,12 +25,15 @@ Class CandyGun : SWWMWeapon
|
|||
if ( !deathmatch && !spareget )
|
||||
{
|
||||
// sell excess
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMScoreObj.Spawn(sellprice,level.Vec3Offset(Owner.pos,SWWMUtility.Vec3FromAngles(FRandom[ScoreBits](0,360),FRandom[ScoreBits](-90,90))*8.+(0,0,Owner.Height/2)));
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player )
|
||||
{
|
||||
if ( Owner.player == players[consoleplayer] ) Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
int sellprice = abs(item.Stamina)/2;
|
||||
SWWMCredits.Give(Owner.player,sellprice);
|
||||
if ( Owner.player == players[consoleplayer] )
|
||||
{
|
||||
SWWMScoreObj.SpawnAtActorBunch(sellprice,Owner);
|
||||
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),GetTag(),sellprice);
|
||||
}
|
||||
else Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRAREM_FEM":"$SWWM_SELLEXTRAREM"),Owner.player.GetUserName(),GetTag(),sellprice);
|
||||
}
|
||||
item.bPickupGood = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue