Configurable floating number colors.

This commit is contained in:
Mari the Deer 2021-01-31 17:59:23 +01:00
commit 4b3c875965
17 changed files with 117 additions and 56 deletions

View file

@ -19,6 +19,11 @@ This is just a bit of *"future planning"* for stuff that I ***might*** add after
- Lithium - Volume One *(A work of art, one of the finest graphic novels)*
- Manarock *("A delicacy for gods, but instantly deadly for mortals")*
- Rubber Duck *("Is this some kind of convoluted joke from those two?")*
* **Original English Voice Acting:**
- Demolitionist
- Ibuki
- Saya
- Kirin
* ***(Maybe)* Fake livestream chat overlay, with dynamic reactions to all sorts of stuff**
* **Leaning and a lot of other stuff involving ViewAngles and ViewPos**
* **Crouch sliding *(+ proper crouch dashing)***

View file

@ -94,6 +94,11 @@ server bool swwm_swapweapons = true; // [DLC1] allows carrying only one weapon
user int swwm_forcestats = 0; // always shows level stats on the HUD, not just when the automap is open (2 - also show map name, otherwise only stats)
user int swwm_funtrails = 0; // recolors trails of eviscerator chunks and sheen bullets
server bool swwm_pistolstart = false; // enforces pistol start for all maps (excluding hubs)
user int swwm_numcolor_scr = 5; // font color for score numbers (default: gold)
user int swwm_numcolor_bonus = 23; // font color for bonus numbers (default: fire)
user int swwm_numcolor_dmg = 6; // font color for damage numbers (default: red)
user int swwm_numcolor_hp = 7; // font color for health numbers (default: blue)
user int swwm_numcolor_ap = 3; // font color for armor numbers (default: green)
// TODO selection order array of weapons, for user tweaking
// if empty, use default selection order defined in zscript

View file

@ -191,6 +191,11 @@ SWWM_TRAILS_MAGENTA = "Magenta";
SWWM_TRAILS_RAINBOW = "Rainbow";
SWWM_TRAILS_TRANS = "TRANS RIGHTS";
SWWM_PISTOLSTART = "Force Pistol Start";
SWWM_NUMCOLOR_SCR = "Score Number Color";
SWWM_NUMCOLOR_BONUS = "Score Bonus Color";
SWWM_NUMCOLOR_DMG = "Damage Number Color";
SWWM_NUMCOLOR_HP = "Health Number Color";
SWWM_NUMCOLOR_AP = "Armor Number Color";
TOOLTIP_SWWM_VOICETYPE = "Sets the voice pack for the player.";
TOOLTIP_SWWM_MUTEVOICE = "Control what gets muted, if you'd rather have a more silent protagonist.";
TOOLTIP_SWWM_FLASHSTRENGTH = "Screen flashes usually happen when firing some weapons, you can lower this if these effects are harmful for you.";
@ -275,6 +280,11 @@ TOOLTIP_SWWM_SWAPWEAPONS = "Allow only one weapon per slot (excluding Deep Impac
TOOLTIP_SWWM_FORCESTATS = "Shows map statistics in the HUD even when the automap isn't open.";
TOOLTIP_SWWM_FUNTRAILS = "Recolors the trails left by slot 5 weapon projectiles.";
TOOLTIP_SWWM_PISTOLSTART = "Forces you to pistol start between levels. This excludes travel between levels within a hub, however.";
TOOLTIP_SWWM_NUMCOLOR_SCR = "Select the color for score numbers.";
TOOLTIP_SWWM_NUMCOLOR_BONUS = "Select the color for bonuses that may accompany score numbers.";
TOOLTIP_SWWM_NUMCOLOR_DMG = "Select the color for damage numbers.";
TOOLTIP_SWWM_NUMCOLOR_HP = "Select the color for health numbers.";
TOOLTIP_SWWM_NUMCOLOR_AP = "Select the color for armor numbers.";
// knowledge base
SWWM_COMINGSOON = "(coming soon)";
SWWM_MISSTAB = "Mission";

View file

@ -188,6 +188,11 @@ SWWM_TRAILS_BLUE = "Azul";
SWWM_TRAILS_MAGENTA = "Magenta";
SWWM_TRAILS_RAINBOW = "Arcoiris";
SWWM_PISTOLSTART = "Forzar Pistol Start";
SWWM_NUMCOLOR_SCR = "Color de Números de Puntos";
SWWM_NUMCOLOR_BONUS = "Color de Bónuses de Puntos";
SWWM_NUMCOLOR_DMG = "Color de Números de Daño";
SWWM_NUMCOLOR_HP = "Color de Números de Salud";
SWWM_NUMCOLOR_AP = "Color de Números de Armadura";
TOOLTIP_SWWM_VOICETYPE = "Selecciona el pack de voz para el jugador.";
TOOLTIP_SWWM_MUTEVOICE = "Controla lo que se mutea, si prefieres tener un protagonista más silencioso.";
TOOLTIP_SWWM_FLASHSTRENGTH = "Los destellos en pantalla suelen ocurrir al disparar algunas armas, puedes reducirlo si este tipo de efectos te causan malestar.";
@ -272,6 +277,11 @@ TOOLTIP_SWWM_SWAPWEAPONS = "Permite solo un arma por puesto (excluyendo Deep Imp
TOOLTIP_SWWM_FORCESTATS = "Muestra estadísticas de mapa en el HUD incluso cuando el automapa no está abierto.";
TOOLTIP_SWWM_FUNTRAILS = "Recolorea los rastros dejados por proyectiles de armas de ranura 5.";
TOOLTIP_SWWM_PISTOLSTART = "Fuerza hacer pistol start entre niveles. Aunque esto excluye viajes entre niveles de un mismo hub.";
TOOLTIP_SWWM_NUMCOLOR_SCR = "Selecciona el color para los numeros de puntos.";
TOOLTIP_SWWM_NUMCOLOR_BONUS = "Selecciona el color para las bonificaciones que pueden acompañar a los números de puntos.";
TOOLTIP_SWWM_NUMCOLOR_DMG = "Selecciona el color para los números de daño.";
TOOLTIP_SWWM_NUMCOLOR_HP = "Selecciona el color para los números de salud.";
TOOLTIP_SWWM_NUMCOLOR_AP = "Selecciona el color para los números de armadura.";
// knowledge base
SWWM_COMINGSOON = "(próximamente)";
SWWM_MISSTAB = "Misión";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r242 \cu(Sat 30 Jan 22:56:20 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r242 \cu(2021-01-30 22:56:20)\c-";
SWWM_MODVER="\chSWWM \czGZ\c- \cw0.9.11b-pre r243 \cu(Sun 31 Jan 17:59:23 CET 2021)\c-";
SWWM_SHORTVER="\cw0.9.11b-pre r243 \cu(2021-01-31 17:59:23)\c-";

View file

@ -108,6 +108,11 @@ OptionMenu "SWWMOptionMenu"
ScaleSlider "$SWWM_SCRSCALE", "swwm_scrscale", 0, 8, 1, "$SWWM_GZSCALE"
ScaleSlider "$SWWM_POISCALE", "swwm_poiscale", 0, 8, 1, "$SWWM_GZSCALE"
ScaleSlider "$SWWM_DETSCALE", "swwm_detscale", 0, 8, 1, "$SWWM_GZSCALE"
Option "$SWWM_NUMCOLOR_SCR", "swwm_numcolor_scr", "TextColors"
Option "$SWWM_NUMCOLOR_BONUS", "swwm_numcolor_bonus", "TextColors"
Option "$SWWM_NUMCOLOR_DMG", "swwm_numcolor_dmg", "TextColors"
Option "$SWWM_NUMCOLOR_HP", "swwm_numcolor_hp", "TextColors"
Option "$SWWM_NUMCOLOR_AP", "swwm_numcolor_ap", "TextColors"
Option "$SWWM_INTERART", "swwm_interart", "YesNo"
Option "$SWWM_INTERMUSIC", "swwm_intermusic", "YesNo"
Option "$SWWM_FUZZ", "swwm_fuzz", "YesNo"

View file

@ -819,9 +819,9 @@ Class BusterWall : Thinker
// damnums
Vector3 bcenter = (bust.boundsmin+bust.boundsmax)*.5;
if ( CVar.GetCVar('swwm_accdamage',players[consoleplayer]).GetBool() )
SWWMScoreObj.Spawn(-bust.accdamage,level.Vec3Offset(bcenter,(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8))),Font.CR_RED);
SWWMScoreObj.Spawn(-bust.accdamage,level.Vec3Offset(bcenter,(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8))),ST_Damage);
else for ( int i=0; i<bust.acchits.Size(); i++ )
SWWMScoreObj.Spawn(-bust.acchits[i],level.Vec3Offset(bcenter,(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8))),Font.CR_RED);
SWWMScoreObj.Spawn(-bust.acchits[i],level.Vec3Offset(bcenter,(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8))),ST_Damage);
return true;
}
}

View file

@ -78,7 +78,7 @@ Class SWWMCollectible : Inventory abstract
// give credit
if ( other.player && (Stamina > 0) )
{
SWWMScoreObj.Spawn(Stamina,other.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+other.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(Stamina,other.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+other.Height/2));
SWWMCredits.Give(other.player,Stamina);
}
// send to all other players

View file

@ -252,6 +252,7 @@ Class SWWMHandler : EventHandler
transient CVar funtags;
transient bool curfuntags;
transient int slotstrictwarn;
transient CVar numcolor_scr, numcolor_bonus, numcolor_dmg, numcolor_hp, numcolor_ap;
// optimization
OnFire fires;
@ -1481,7 +1482,7 @@ Class SWWMHandler : EventHandler
break;
}
}
if ( spawnme ) SWWMScoreObj.Spawn(-e.Damage,e.Thing.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+e.Thing.Height/2),Font.CR_RED,e.Thing);
if ( spawnme ) SWWMScoreObj.Spawn(-e.Damage,e.Thing.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+e.Thing.Height/2),ST_Damage,e.Thing);
// update combat tracker for it
if ( !(e.Thing is 'BossBrain') )
{
@ -1584,7 +1585,6 @@ Class SWWMHandler : EventHandler
if ( scr )
{
scr.xscore[ofs] = 0;
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_SHAMEFUL");
scr.xcnt = ++ofs;
}
@ -1595,7 +1595,6 @@ Class SWWMHandler : EventHandler
if ( scr )
{
scr.xscore[ofs] = 0;
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_BUTTSLAM");
scr.xcnt = ++ofs;
}
@ -1617,7 +1616,6 @@ Class SWWMHandler : EventHandler
if ( scr )
{
scr.xscore[ofs] = 0;
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_OVERKILL");
scr.xcnt = ++ofs;
}
@ -1628,7 +1626,6 @@ Class SWWMHandler : EventHandler
if ( scr )
{
scr.xscore[ofs] = (multilevel[pnum]>=16)?int.max:(multilevel[pnum]+1);
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_MULTIKILL");
scr.xcnt = ++ofs;
}
@ -1645,7 +1642,6 @@ Class SWWMHandler : EventHandler
if ( (spreecount[pnum] > 0) && scr )
{
scr.xscore[ofs] = spreecount[pnum];
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_SPREEKILL");
scr.xcnt = ++ofs;
}
@ -1656,7 +1652,6 @@ Class SWWMHandler : EventHandler
if ( scr )
{
scr.xscore[ofs] = 0;
scr.xtcolor[ofs] = Font.CR_FIRE;
scr.xstr[ofs] = StringTable.Localize("$SWWM_BOSSKILL");
scr.xcnt = ++ofs;
}

View file

@ -57,7 +57,7 @@ Class RefresherRegen : Powerup
{
if ( Owner.GiveBody(int(Strength),500) )
{
SWWMScoreObj.Spawn(int(Strength),Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(int(Strength),Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
SWWMHandler.DoFlash(Owner,Color(32,224,128,255),10);
Owner.A_StartSound("powerup/refresher",CHAN_ITEM,CHANF_LOCAL,.4);
}

View file

@ -794,21 +794,24 @@ Class SWWMStatusBar : BaseStatusBar
double alph = clamp((snum.lifespan+fractic)/35.,0.,1.);
Vector2 fo = (0,0);
bool isscore = false;
if ( snum.tcolor == Font.CR_RED )
if ( snum.damnum )
{
// damage falls down
int initspd = (128-snum.seed);
int boostup = 64+snum.seed2;
fo.x = (.05*initspd)*((snum.initialspan-(snum.lifespan-fractic))**.8);
fo.y = -((snum.initialspan-(snum.lifespan-fractic))**1.5)+boostup*sin((90./snum.initialspan)*(level.maptime+fractic-snum.starttic));
}
else if ( (snum.tcolor == Font.CR_GREEN) || (snum.tcolor == Font.CR_BLUE) )
{
// health falls up (?)
int initspd = (128-snum.seed);
int boostup = 16+snum.seed2/4;
fo.x = (.15*initspd)*((snum.initialspan-(snum.lifespan-fractic))**.6);
fo.y = ((snum.initialspan-(snum.lifespan-fractic))**1.2)-boostup*sin((90./snum.initialspan)*(level.maptime+fractic-snum.starttic));
if ( snum.score < 0 )
{
// damage falls down
int initspd = (128-snum.seed);
int boostup = 64+snum.seed2;
fo.x = (.05*initspd)*((snum.initialspan-(snum.lifespan-fractic))**.8);
fo.y = -((snum.initialspan-(snum.lifespan-fractic))**1.5)+boostup*sin((90./snum.initialspan)*(level.maptime+fractic-snum.starttic));
}
else
{
// health falls up (?)
int initspd = (128-snum.seed);
int boostup = 16+snum.seed2/4;
fo.x = (.15*initspd)*((snum.initialspan-(snum.lifespan-fractic))**.6);
fo.y = ((snum.initialspan-(snum.lifespan-fractic))**1.2)-boostup*sin((90./snum.initialspan)*(level.maptime+fractic-snum.starttic));
}
}
else
{
@ -817,10 +820,9 @@ Class SWWMStatusBar : BaseStatusBar
isscore = true;
}
Font fnt = mMiniwiFont.mFont;
if ( isscore )
Screen.DrawText(fnt,snum.tcolor,(vpos.x-hss.x*(fo.x+fnt.StringWidth(tag)/2.))/hss.x,(vpos.y-hss.y*(fo.y+(fnt.GetHeight()/2.)))/hss.y,tag,DTA_VirtualWidthF,sss.x,DTA_VirtualHeightF,sss.y,DTA_KeepRatio,true,DTA_Alpha,alph);
else
Screen.DrawText(fnt,snum.tcolor,(vpos.x-hsn.x*(fo.x+fnt.StringWidth(tag)/2.))/hsn.x,(vpos.y-hsn.y*(fo.y+(fnt.GetHeight()/2.)))/hsn.y,tag,DTA_VirtualWidthF,ssn.x,DTA_VirtualHeightF,ssn.y,DTA_KeepRatio,true,DTA_Alpha,alph);
Vector2 hs0 = isscore?hss:hsn;
Vector2 ss0 = isscore?sss:ssn;
Screen.DrawText(fnt,snum.tcolor,(vpos.x-hs0.x*(fo.x+fnt.StringWidth(tag)/2.))/hs0.x,(vpos.y-hs0.y*(fo.y+(fnt.GetHeight()/2.)))/hs0.y,tag,DTA_VirtualWidthF,ss0.x,DTA_VirtualHeightF,ss0.y,DTA_KeepRatio,true,DTA_Alpha,alph);
// extra strings (if available)
if ( !scorebonus.GetBool() ) continue;
fo.y += fnt.GetHeight();

View file

@ -10,7 +10,7 @@ Mixin Class SWWMAutoUseFix
if ( bALWAYSPICKUP && (Amount+item.Amount > MaxAmount) && (Stamina > 0) )
{
int sellprice = int(Stamina*.5);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),Owner.player.GetUserName(),GetTag(),sellprice);
@ -212,7 +212,7 @@ Class SWWMArmor : Armor abstract
while ( (amount <= (MaxAmount-default.Amount)) && (Owner.CountInv(parent) > 0) )
{
if ( acc ) tgive += default.Amount;
else SWWMScoreObj.Spawn(default.Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
else SWWMScoreObj.Spawn(default.Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
Amount += default.Amount;
Owner.TakeInventory(parent,1);
// absorb the extra damage too
@ -225,7 +225,7 @@ Class SWWMArmor : Armor abstract
amount -= saved;
damage = newdamage;
}
if ( acc ) SWWMScoreObj.Spawn(tgive,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
if ( acc ) SWWMScoreObj.Spawn(tgive,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
}
else if ( amount <= 0 )
{
@ -259,7 +259,7 @@ Class SWWMSpareArmor : Inventory abstract
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount);
SWWMHandler.ArmorFlash(Owner.PlayerNumber());
SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
return true;
}
return false;
@ -363,7 +363,7 @@ Class SWWMHealth : Inventory abstract
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
SWWMHandler.HealthFlash(Owner.PlayerNumber());
Owner.GiveInventory(giveme,GetDefaultByType(giveme).Amount);
SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
AutoUseExtra(false);
return true;
}
@ -410,7 +410,7 @@ Class SWWMHealth : Inventory abstract
while ( (Amount > 0) && (newdamage > 0) )
{
if ( acc ) tgive += GetDefaultByType(giveme).Amount;
else SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
else SWWMScoreObj.Spawn(GetDefaultByType(giveme).Amount,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
newdamage = newdamage-GetDefaultByType(giveme).Amount;
if ( newdamage < 0 ) Owner.GiveBody(-newdamage,GetDefaultByType(giveme).MaxAmount);
newdamage = max(0,newdamage);
@ -418,7 +418,7 @@ Class SWWMHealth : Inventory abstract
morethanonce = true;
Amount--;
}
if ( acc ) SWWMScoreObj.Spawn(tgive,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
if ( acc ) SWWMScoreObj.Spawn(tgive,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
}
else newdamage = damage;
}
@ -1200,7 +1200,7 @@ Class SWWMWeapon : Weapon abstract
{
// sell excess
int sellprice = item.Stamina/2;
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),Owner.player.GetUserName(),GetTag(),sellprice);

View file

@ -1542,7 +1542,7 @@ Class Demolitionist : PlayerPawn
}
SWWMHandler.DoFlash(self,Color(255,255,255,255),10);
SWWMHandler.DoFlash(self,Color(255,128,192,255),30);
SWWMScoreObj.Spawn(default.health,Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(default.health,Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Height/2),ST_Health);
if ( special1 > 2 ) special1 = 0;
if ( swwm_revivecooldown > 0 )
GiveInventory("ReviveCooldown",1);
@ -3111,7 +3111,7 @@ Class LoveHeart : Actor
}
if ( target.GiveBody(healamt,target.GetSpawnHealth()) )
{
SWWMScoreObj.Spawn(healamt,target.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+target.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(healamt,target.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+target.Height/2),ST_Health);
SWWMHandler.DoFlash(target,Color(32,224,128,255),10);
}
if ( target is 'MBFHelperDog' )
@ -3524,7 +3524,7 @@ Class SWWMGesture : SWWMWeapon
}
if ( pt.target.GiveBody(healamt,pt.target.GetSpawnHealth()) )
{
SWWMScoreObj.Spawn(healamt,pt.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+pt.target.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(healamt,pt.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+pt.target.Height/2),ST_Health);
SWWMHandler.DoFlash(pt.target,Color(32,224,128,255),10);
}
}

View file

@ -38,14 +38,14 @@ 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,rollIntensity:1.);
Owner.GiveBody(1000,1000);
SWWMScoreObj.Spawn(1000,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(1000,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
if ( CVar.GetCVar('swwm_accdamage',players[consoleplayer]).GetBool() )
SWWMScoreObj.Spawn(600,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
SWWMScoreObj.Spawn(600,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
else
{
SWWMScoreObj.Spawn(200,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
SWWMScoreObj.Spawn(150,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
SWWMScoreObj.Spawn(250,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GREEN);
SWWMScoreObj.Spawn(200,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
SWWMScoreObj.Spawn(150,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
SWWMScoreObj.Spawn(250,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Armor);
}
let n = Owner.FindInventory("ArmorNugget");
if ( !n ) Owner.GiveInventory("ArmorNugget",GetDefaultByType("ArmorNugget").MaxAmount);
@ -913,7 +913,7 @@ Class RagekitPower : Powerup
{
SWWMHandler.DoFlash(Owner,Color(16,255,0,0),5);
if ( Owner.GiveBody(1,100) )
SWWMScoreObj.Spawn(1,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(1,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
Owner.A_AlertMonsters(swwm_uncapalert?0:2000);
if ( (Owner.player == players[consoleplayer]) && (gametic > lastrage) && (CVar.GetCVar('swwm_mutevoice',players[consoleplayer]).GetInt() < 2) )
lastrage = SWWMHandler.AddOneliner("ragekit",2,5)+40;
@ -960,7 +960,7 @@ Class RagekitPower : Powerup
{
if ( level.maptime <= lasteffect+5 ) return;
if ( Owner.GiveBody(5,100) )
SWWMScoreObj.Spawn(5,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(5,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
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,rollIntensity:1.);
@ -1008,7 +1008,7 @@ Class Ragekit : Inventory
if ( pickup && !deathmatch ) return false;
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
if ( Owner.GiveBody(100,100) )
SWWMScoreObj.Spawn(100,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_BLUE);
SWWMScoreObj.Spawn(100,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),ST_Health);
if ( !(Owner is 'Demolitionist') )
{
SWWMHandler.DoFlash(Owner,Color(64,255,0,0),30);
@ -1676,7 +1676,7 @@ Class SWWMLamp : Inventory
{
// sell excess
int sellprice = SWWMUtility.Round100(Stamina*.7);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),Owner.player.GetUserName(),GetTag(),sellprice);

View file

@ -347,7 +347,7 @@ Class ExplodiumGun : SWWMWeapon
{
// sell excess
int sellprice = int(Stamina*.5);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),Owner.player.GetUserName(),GetTag(),sellprice);

View file

@ -910,7 +910,7 @@ Class CandyGun : SWWMWeapon
{
// sell excess
int sellprice = item.Stamina/2;
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2),Font.CR_GOLD);
SWWMScoreObj.Spawn(sellprice,Owner.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+Owner.Height/2));
SWWMCredits.Give(Owner.player,sellprice);
if ( Owner.player )
Console.Printf(StringTable.Localize(SWWMUtility.SellFemaleItem(item)?"$SWWM_SELLEXTRA_FEM":"$SWWM_SELLEXTRA"),Owner.player.GetUserName(),GetTag(),sellprice);

View file

@ -631,6 +631,14 @@ Class SWWMLoreLibrary : Thinker
}
}
Enum EScoreObjType
{
ST_Score,
ST_Damage,
ST_Health,
ST_Armor
};
// floating scores
Class SWWMScoreObj : Thinker
{
@ -647,7 +655,7 @@ Class SWWMScoreObj : Thinker
bool damnum;
Actor acc;
static SWWMScoreObj Spawn( int score, Vector3 pos, int tcolor = Font.CR_GOLD, Actor acc = null )
static SWWMScoreObj Spawn( int score, Vector3 pos, int type = ST_Score, Actor acc = null, int tcolor = -1 )
{
let hnd = SWWMHandler(EventHandler.Find("SWWMHandler"));
if ( !hnd ) return null;
@ -656,12 +664,33 @@ Class SWWMScoreObj : Thinker
o.score = score;
o.pos = pos;
o.lifespan = o.initialspan = 60;
o.tcolor = tcolor;
if ( !hnd.numcolor_scr ) hnd.numcolor_scr = CVar.GetCVar('swwm_numcolor_scr',players[consoleplayer]);
if ( !hnd.numcolor_bonus ) hnd.numcolor_bonus = CVar.GetCVar('swwm_numcolor_bonus',players[consoleplayer]);
if ( !hnd.numcolor_dmg ) hnd.numcolor_dmg = CVar.GetCVar('swwm_numcolor_dmg',players[consoleplayer]);
if ( !hnd.numcolor_hp ) hnd.numcolor_hp = CVar.GetCVar('swwm_numcolor_hp',players[consoleplayer]);
if ( !hnd.numcolor_ap ) hnd.numcolor_ap = CVar.GetCVar('swwm_numcolor_ap',players[consoleplayer]);
if ( tcolor != -1 ) o.tcolor = tcolor;
else switch ( type )
{
case ST_Score:
o.tcolor = hnd.numcolor_scr.GetInt();
break;
case ST_Damage:
o.tcolor = hnd.numcolor_dmg.GetInt();
break;
case ST_Health:
o.tcolor = hnd.numcolor_hp.GetInt();
break;
case ST_Armor:
o.tcolor = hnd.numcolor_ap.GetInt();
break;
}
o.starttic = level.maptime;
o.seed = Random[ScoreBits]();
o.seed2 = Random[ScoreBits]();
o.damnum = (tcolor == Font.CR_RED) || (tcolor == Font.CR_GREEN) || (tcolor == Font.CR_BLUE);
o.damnum = (type > ST_Score);
o.xcnt = 0;
for ( int i=0; i<5; i++ ) o.xtcolor[i] = hnd.numcolor_bonus.GetInt();
o.acc = acc;
if ( o.damnum )
{