Tag colors and animated face using A_ChangeModel.

This commit is contained in:
Mari the Deer 2022-07-26 18:36:38 +02:00
commit 2d2dcf7ad5
28 changed files with 350 additions and 189 deletions

View file

@ -1,5 +1,6 @@
// main mod cvars
user string swwm_voicetype = "default"; // voice for your demolitionist
user int swwm_tagcolor = 0; // customize glowing tag color
nosave float swwm_flashstrength = 1.0; // strength of screen flashes
nosave int swwm_hudmargin = 10; // margin around fullscreen hud elements
nosave int swwm_maxshown = 4; // max messages to show normally

View file

@ -46,6 +46,18 @@ Brightmap Texture "models/DemoFace_Ouch.png"
{
Map "models/DemoFace_bright.png"
}
Brightmap Texture "models/DemoFace_Sad.png"
{
Map "models/DemoFace_bright.png"
}
Brightmap Texture "models/DemoFace_Smug.png"
{
Map "models/DemoFace_bright.png"
}
Brightmap Texture "models/DemoFace_Unamused.png"
{
Map "models/DemoFace_bright.png"
}
Brightmap Texture "models/DemoFace_Wink.png"
{
Map "models/DemoFace_bright.png"
@ -54,3 +66,55 @@ Brightmap Texture "models/DemoTags.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsBlue.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsCyan.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsDragonfly.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsGold.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsMagenta.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsOrange.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsPeach.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsPink.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsPurple.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsRed.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsViolet.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsWhite.png"
{
Map "models/DemoTags_bright.png"
}
Brightmap Texture "models/DemoTagsYellow.png"
{
Map "models/DemoTags_bright.png"
}

View file

@ -210,6 +210,21 @@ SWWM_SKIPSKILL = "Skip Skill Confirmation";
SWWM_HUDTRIMAMMO = "Trim Ammo List";
SWWM_HUDMUGSHOT = "Face In HUD";
SWWM_NOINTROEX = "Skip Intro Explosions";
SWWM_TAGCOLOR = "Tag Color";
SWWM_COL_0 = "Green";
SWWM_COL_1 = "Blue";
SWWM_COL_2 = "Cyan";
SWWM_COL_3 = "Dragonfly";
SWWM_COL_4 = "Gold";
SWWM_COL_5 = "Magenta";
SWWM_COL_6 = "Orange";
SWWM_COL_7 = "Peach";
SWWM_COL_8 = "Pink";
SWWM_COL_9 = "Purple";
SWWM_COL_10 = "Red";
SWWM_COL_11 = "Violet";
SWWM_COL_12 = "White";
SWWM_COL_13 = "Yellow";
SWWM_MM_ENABLE = "Show Minimap";
SWWM_MM_MISSILES = "Projectiles In Minimap";
SWWM_MM_COLORSET = "Minimap Color Set";
@ -350,7 +365,7 @@ TOOLTIP_SWWM_SKIPSKILL = "Skips confirmation of skill selection, if you get tire
TOOLTIP_SWWM_HUDTRIMAMMO = "Only shows ammo for currently carried weapons in the HUD.";
TOOLTIP_SWWM_HUDMUGSHOT = "Shows the Demolitionist's face in the HUD, for a more classic touch.";
TOOLTIP_SWWM_NOINTROEX = "Skips the explosion sequence over the original titlepic.";
TOOLTIP_SWWMMINIMAPMENU = "Configure the minimap.";
TOOLTIP_SWWM_TAGCOLOR = "Changes the color for the glowing tags on various parts of the player's body.";
TOOLTIP_SWWMACHIEVEMENTMENU = "View your achievements.";
TOOLTIP_SWWM_MM_ENABLE = "Displays a minimap on the top right corner of the screen.";
TOOLTIP_SWWM_MM_MISSILES = "Displays projectiles in the minimap. Can be toggled if this clutters too much.";

View file

@ -209,6 +209,20 @@ SWWM_SKIPSKILL = "Saltar Confirmación de Dificultad";
SWWM_HUDTRIMAMMO = "Recortar Lista de Munición";
SWWM_HUDMUGSHOT = "Rostro en el HUD";
SWWM_NOINTROEX = "Saltar Intro de Explosiones";
SWWM_TAGCOLOR = "Color de Marcas";
SWWM_COL_0 = "Verde";
SWWM_COL_1 = "Azul";
SWWM_COL_2 = "Cian";
SWWM_COL_3 = "Libélula";
SWWM_COL_4 = "Dorado";
SWWM_COL_6 = "Naranja";
SWWM_COL_7 = "Melocotón";
SWWM_COL_8 = "Rosa";
SWWM_COL_9 = "Púrpura";
SWWM_COL_10 = "Rojo";
SWWM_COL_11 = "Violeta";
SWWM_COL_12 = "Blanco";
SWWM_COL_13 = "Amarillo";
SWWM_MM_ENABLE = "Mostrar Minimapa";
SWWM_MM_MISSILES = "Proyectiles en Minimapa";
SWWM_MM_COLORSET = "Set de Colores de Minimapa";
@ -354,7 +368,7 @@ TOOLTIP_SWWM_SKIPSKILL = "Salta la confirmación de selección de dificultad, si
TOOLTIP_SWWM_HUDTRIMAMMO = "Muestra solo la munición de las armas obtenidas en el HUD.";
TOOLTIP_SWWM_HUDMUGSHOT = "Muestra el rostro de la Demolicionista en el HUD, para un toque más clásico.";
TOOLTIP_SWWM_NOINTROEX = "Salta la secuencia de explosiones sobre la imagen de título original.";
TOOLTIP_SWWMMINIMAPMENU = "Configura el minimapa.";
TOOLTIP_SWWM_TAGCOLOR = "Cambia el color de las marcas brillantes en varias partes del cuerpo del jugador.";
TOOLTIP_SWWMACHIEVEMENTMENU = "Revisa tus logros.";
TOOLTIP_SWWM_MM_ENABLE = "Muestra un minimapa en la esquina superior derecha de la pantalla.";
TOOLTIP_SWWM_MM_MISSILES = "Muestra proyectiles en el minimapa. Puede ser desactivado si causa problemas de visibilidad.";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r216 \cu(Tue 26 Jul 17:13:42 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r216 \cu(2022-07-26 17:13:42)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r218 \cu(Tue 26 Jul 18:36:38 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r218 \cu(2022-07-26 18:36:38)\c-";

View file

@ -88,6 +88,23 @@ OptionValue "SWWMMinimapColorset"
3, "$SWWM_STRIFECOLORS"
4, "$SWWM_RAVENCOLORS"
}
OptionValue "SWWMTagColor"
{
0, "$SWWM_COL_0"
1, "$SWWM_COL_1"
2, "$SWWM_COL_2"
3, "$SWWM_COL_3"
4, "$SWWM_COL_4"
5, "$SWWM_COL_5"
6, "$SWWM_COL_6"
7, "$SWWM_COL_7"
8, "$SWWM_COL_8"
9, "$SWWM_COL_9"
10, "$SWWM_COL_10"
11, "$SWWM_COL_11"
12, "$SWWM_COL_12"
13, "$SWWM_COL_13"
}
OptionMenu "SWWMOptionMenu"
{
Class "SWWMOptionMenu"
@ -101,6 +118,7 @@ OptionMenu "SWWMOptionMenu"
StaticText "$SWWM_PTITLE", 1
SWWMPlayTime "$SWWM_PLAYTIME", "swwm_playtime"
SWWMVoiceOption "$SWWM_VOICETYPE", "swwm_voicetype"
Option "$SWWM_TAGCOLOR", "swwm_tagcolor", "SWWMTagColor"
Option "$SWWM_MUTELEVEL", "swwm_mutevoice", "SWWMVoice"
Slider "$SWWM_VOICEAMP", "swwm_voiceamp", 1, 4, 1, 0
Option "$SWWM_VOICELOG", "swwm_voicelog", "YesNo"

View file

@ -59,42 +59,29 @@ Model "Demolitionist"
FrameIndex XZW2 K 0 39
FrameIndex XZW2 L 0 40
// Pain
SurfaceSkin 0 1 "DemoFace_Hurt.png"
FrameIndex XZW2 M 0 42
FrameIndex XZW2 N 0 43
FrameIndex XZW2 O 0 44
FrameIndex XZW2 P 0 45
FrameIndex XZW2 Q 0 46
SurfaceSkin 0 1 "DemoFace_Default.png"
// Death
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW2 R 0 48
FrameIndex XZW2 S 0 49
FrameIndex XZW2 T 0 50
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW2 U 0 51
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW2 V 0 52
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW2 W 0 53
FrameIndex XZW2 X 0 54
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW2 Y 0 55
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW2 Z 0 56
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW3 A 0 57
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW3 B 0 58
FrameIndex XZW3 C 0 59
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW3 D 0 60
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW3 E 0 61
FrameIndex XZW3 F 0 62
FrameIndex XZW3 G 0 63
FrameIndex XZW3 H 0 64
SurfaceSkin 0 1 "DemoFace_Default.png"
// Jump
FrameIndex XZW3 I 0 66
FrameIndex XZW3 J 0 67
@ -168,7 +155,6 @@ Model "Demolitionist"
FrameIndex XZW5 P 0 130
FrameIndex XZW5 Q 0 131
FrameIndex XZW5 R 0 132
SurfaceSkin 0 1 "DemoFace_Grin.png"
FrameIndex XZW5 S 0 133
FrameIndex XZW5 T 0 134
FrameIndex XZW5 U 0 135
@ -176,7 +162,6 @@ Model "Demolitionist"
FrameIndex XZW5 W 0 137
FrameIndex XZW5 X 0 138
FrameIndex XZW5 Y 0 139
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZW5 Z 0 140
FrameIndex XZW6 A 0 141
FrameIndex XZW6 B 0 142
@ -187,7 +172,6 @@ Model "Demolitionist"
FrameIndex XZW6 F 0 147
FrameIndex XZW6 G 0 148
FrameIndex XZW6 H 0 149
SurfaceSkin 0 1 "DemoFace_Grin.png"
FrameIndex XZW6 I 0 150
FrameIndex XZW6 J 0 151
FrameIndex XZW6 K 0 152
@ -200,7 +184,6 @@ Model "Demolitionist"
FrameIndex XZW6 R 0 159
FrameIndex XZW6 S 0 160
FrameIndex XZW6 T 0 161
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZW6 U 0 162
FrameIndex XZW6 V 0 163
FrameIndex XZW6 W 0 164
@ -240,24 +223,17 @@ Model "Demolitionist"
FrameIndex XZW8 A 0 197
FrameIndex XZW8 B 0 198
// Crouched Pain
SurfaceSkin 0 1 "DemoFace_Hurt.png"
FrameIndex XZW8 C 0 200
FrameIndex XZW8 D 0 201
FrameIndex XZW8 E 0 202
FrameIndex XZW8 F 0 203
SurfaceSkin 0 1 "DemoFace_Default.png"
// Crouched Death
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW8 G 0 205
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW8 H 0 206
SurfaceSkin 0 1 "DemoFace_Dead.png"
FrameIndex XZW8 I 0 207
FrameIndex XZW8 J 0 208
SurfaceSkin 0 1 "DemoFace_Off.png"
FrameIndex XZW8 K 0 209
FrameIndex XZW8 L 0 210
SurfaceSkin 0 1 "DemoFace_Default.png"
// Uncrouch
FrameIndex XZW8 M 0 212
FrameIndex XZW8 N 0 213
@ -396,23 +372,19 @@ Model "Demolitionist"
FrameIndex XZWD F 0 344
FrameIndex XZWD G 0 345
FrameIndex XZWD H 0 346
SurfaceSkin 0 1 "DemoFace_Blink.png"
FrameIndex XZWD I 0 347
FrameIndex XZWD J 0 348
FrameIndex XZWD K 0 349
FrameIndex XZWD L 0 350
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWD M 0 351
FrameIndex XZWD N 0 352
FrameIndex XZWD O 0 353
SurfaceSkin 0 1 "DemoFace_Wink.png"
FrameIndex XZWD P 0 354
FrameIndex XZWD Q 0 355
FrameIndex XZWD R 0 356
FrameIndex XZWD S 0 357
FrameIndex XZWD T 0 358
FrameIndex XZWD U 0 359
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWD V 0 360
FrameIndex XZWD W 0 361
// Float
@ -470,7 +442,6 @@ Model "Demolitionist"
FrameIndex XZWF R 0 415
FrameIndex XZWF S 0 416
FrameIndex XZWF T 0 417
SurfaceSkin 0 1 "DemoFace_Grin.png"
FrameIndex XZWF U 0 418
FrameIndex XZWF V 0 419
FrameIndex XZWF W 0 420
@ -478,7 +449,6 @@ Model "Demolitionist"
FrameIndex XZWF Y 0 422
FrameIndex XZWF Z 0 423
FrameIndex XZWG A 0 424
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWG B 0 425
FrameIndex XZWG C 0 426
FrameIndex XZWG D 0 427
@ -489,7 +459,6 @@ Model "Demolitionist"
FrameIndex XZWG H 0 432
FrameIndex XZWG I 0 433
FrameIndex XZWG J 0 434
SurfaceSkin 0 1 "DemoFace_Grin.png"
FrameIndex XZWG K 0 435
FrameIndex XZWG L 0 436
FrameIndex XZWG M 0 437
@ -502,7 +471,6 @@ Model "Demolitionist"
FrameIndex XZWG T 0 444
FrameIndex XZWG U 0 445
FrameIndex XZWG V 0 446
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWG W 0 447
FrameIndex XZWG X 0 448
FrameIndex XZWG Y 0 449
@ -511,30 +479,25 @@ Model "Demolitionist"
FrameIndex XZWH A 0 452
FrameIndex XZWH B 0 453
FrameIndex XZWH C 0 454
SurfaceSkin 0 1 "DemoFace_Blink.png"
FrameIndex XZWH D 0 455
FrameIndex XZWH E 0 456
FrameIndex XZWH F 0 457
FrameIndex XZWH G 0 458
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWH H 0 459
FrameIndex XZWH I 0 460
FrameIndex XZWH J 0 461
SurfaceSkin 0 1 "DemoFace_Wink.png"
FrameIndex XZWH K 0 462
FrameIndex XZWH L 0 463
FrameIndex XZWH M 0 464
FrameIndex XZWH N 0 465
FrameIndex XZWH O 0 466
FrameIndex XZWH P 0 467
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWH Q 0 468
FrameIndex XZWH R 0 469
// Headpat
FrameIndex XZWH S 0 472
FrameIndex XZWH T 0 473
FrameIndex XZWH U 0 474
SurfaceSkin 0 1 "DemoFace_Grin.png"
FrameIndex XZWH V 0 475
FrameIndex XZWH W 0 476
FrameIndex XZWH X 0 477 // PatStart
@ -551,7 +514,6 @@ Model "Demolitionist"
FrameIndex XZWI I 0 488 // PatEnd
FrameIndex XZWI J 0 489
FrameIndex XZWI K 0 490
SurfaceSkin 0 1 "DemoFace_Default.png"
FrameIndex XZWI L 0 491
FrameIndex XZWI M 0 492
FrameIndex XZWI N 0 493

BIN
models/DemoTagsBlue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsCyan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
models/DemoTagsGold.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsMagenta.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsOrange.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsPeach.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsPink.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsPurple.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsRed.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsViolet.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
models/DemoTagsWhite.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
models/DemoTagsYellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

@ -142,7 +142,7 @@ extend Class SWWMHandler
if ( !lastcombat || (gametic > lastcombat+20) )
{
lastcombat = AddOneliner("hitfriend",1,10);
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).lastsad = gametic;
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).facesad = true;
}
highesttic = gametic;
}
@ -173,7 +173,7 @@ extend Class SWWMHandler
if ( e.Thing.IsFriend(src) )
{
lastcombat = AddOneliner("friendkill",1,5);
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).lastsad = gametic;
if ( Demolitionist(e.DamageSource) ) Demolitionist(e.DamageSource).facesad = true;
}
else if ( (!lastcombat || (gametic > lastcombat+50)) && !SWWMHDoomHandler.IsCuteGirl(e.Thing) ) // [HDoom] don't shout at the girls
{

View file

@ -109,7 +109,7 @@ extend Class SWWMHandler
}
SendNetworkEvent("swwmremoteliner."..onelinersnd,consoleplayer,onelinerlevel);
// hack due to the fact this one can be cancelled early
if ( onelinertype == "falling" ) Demolitionist(players[consoleplayer].mo).lastgrin = gametic;
if ( onelinertype == "falling" ) Demolitionist(players[consoleplayer].mo).facegrin = true;
}
onelinertic = 0;
onelinerspan = 0;

View file

@ -65,19 +65,6 @@ Enum EMiniHUDFontColor
NUM_MINIHUD_COLOR
};
Enum EDemoFaceState
{
FS_DEFAULT,
FS_EVIL,
FS_GRIN,
FS_WINK,
FS_BLINK,
FS_SAD,
FS_PAIN,
FS_OUCH,
FS_DEAD // UNUSED
};
Class SWWMStatusBar : BaseStatusBar
{
TextureID StatusTex, WeaponTex, ScoreTex, InventoryTex, ChatTex[6],
@ -188,10 +175,6 @@ Class SWWMStatusBar : BaseStatusBar
SmoothDynamicValueInterpolator HealthInter, FuelInter, DashInter;
SmoothLinearValueInterpolator LagHealthInter;
EDemoFaceState facestate;
int paindir;
int facetimer;
int blinktime;
transient ui int rss;
override void FlushNotify()
@ -1043,89 +1026,9 @@ Class SWWMStatusBar : BaseStatusBar
qsort_playerscore(a,p+1,h);
}
private void UpdateMugState()
{
let d = Demolitionist(CPlayer.mo);
if ( !d ) return;
// damage handling
if ( d.lastdamagetic && (d.lastdamagetic == gametic) )
{
if ( d.lastdamage > 70 )
{
facestate = FS_OUCH;
facetimer = (d.lastdamagetimer-gametic)+10;
}
else if ( facestate < FS_OUCH )
{
facestate = FS_PAIN;
facetimer = (d.lastdamagetimer-gametic)+10;
paindir = 0;
// paraphrased from vanilla, with some tweaks
if ( CPlayer.attacker && (CPlayer.attacker != d) && d )
{
double atkang = d.AngleTo(CPlayer.attacker);
double angdiff = Actor.deltaangle(CPlayer.mo.angle,atkang);
if ( abs(angdiff) < 135 )
{
if ( angdiff > 45 ) paindir = -1;
else if ( angdiff < -45 ) paindir = 1;
}
}
}
}
if ( d.lastgrin && (d.lastgrin == gametic) && (facestate < FS_SAD) )
{
facestate = FS_GRIN;
facetimer = 50;
}
if ( d.lastwink && (d.lastwink == gametic) && (facestate < FS_SAD) )
{
facestate = FS_WINK;
facetimer = 20;
}
if ( d.lastblink && (d.lastblink == gametic) && (facestate < FS_PAIN) )
{
facestate = FS_BLINK;
facetimer = 30;
}
if ( d.lastsad && (d.lastsad == gametic) && (facestate <= FS_SAD) )
{
facestate = FS_SAD;
facetimer = 50;
}
if ( CPlayer.mo.FindInventory("RagekitPower") && (facestate < FS_PAIN) )
{
facestate = FS_EVIL;
facetimer = 10;
}
if ( facetimer > 0 )
{
facetimer--;
if ( facetimer <= 0 )
{
facestate = FS_DEFAULT;
blinktime = 30;
}
}
if ( !(gametic&1) )
{
if ( blinktime <= 0 )
{
blinktime--;
if ( blinktime < -3 )
{
rss = int(MSTimeF());
blinktime = (abs(GetRandom())%10)?(40+abs(GetRandom())%40):6;
}
}
else blinktime--;
}
}
// separated so they can be auto-ticked by the demolitionist menu
void TickInterpolators()
{
UpdateMugState();
ScoreInter.Update(SWWMCredits.Get(CPlayer));
int hp = CPlayer.Health;
HealthInter.Update(hp);
@ -1553,7 +1456,6 @@ Class SWWMStatusBar : BaseStatusBar
FaceTex[17] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Sad.png",TexMan.Type_Any);
FaceTex[18] = TexMan.CheckForTexture("graphics/HUD/DemoFace_Wink.png",TexMan.Type_Any);
// other expressions will be added when needed
blinktime = 30;
mSmallFont = Font.GetFont('TewiFont');
mBigFont = Font.GetFont('TewiFontOutline');
mTinyFont = Font.GetFont('MiniwiFont');
@ -3026,10 +2928,14 @@ Class SWWMStatusBar : BaseStatusBar
return ((abs(sd)%11)-5)*.1;
}
private int GetFaceTex()
private int GetFaceTex( Demolitionist demo )
{
let facestate = demo.facestate;
let paindir = demo.paindir;
let facetimer = demo.facetimer;
let blinktime = demo.blinktime;
if ( CPlayer.Health <= 0 ) return 11;
if ( (isInvulnerable() || CPlayer.mo.FindInventory("InvinciballPower")) && (facestate >= FS_PAIN) ) return 12;
if ( (isInvulnerable() || demo.FindInventory("InvinciballPower")) && (facestate >= FS_PAIN) ) return 12;
if ( facestate == FS_OUCH ) return 10;
if ( facestate == FS_PAIN ) return (paindir==1)?8:(paindir==-1)?9:7;
if ( facestate == FS_GRIN ) return 5;
@ -3075,7 +2981,7 @@ Class SWWMStatusBar : BaseStatusBar
Screen.DrawTexture(FaceTex[0],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_FillColor,Color(0,0,0),DTA_Alpha,.25*(1.-min(1.,noiz)));
Screen.DrawTexture(FaceTex[1],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_FillColor,Color(255,0,0),DTA_Alpha,.25*min(1.,noiz));
}
Screen.DrawTexture(FaceTex[GetFaceTex()],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
Screen.DrawTexture(FaceTex[GetFaceTex(demo)],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true);
if ( CPlayer.mo.FindInventory("BarrierPower") ) Screen.DrawTexture(FaceTex[14],false,margin+shake.x,ss.y-(margin+32)+shake.y,DTA_VirtualWidthF,ss.x,DTA_VirtualHeightF,ss.y,DTA_KeepRatio,true,DTA_Alpha,.5,DTA_LegacyRenderStyle,STYLE_Add);
}

View file

@ -83,7 +83,7 @@ Class SayaBeanGesture : SWWMItemGesture
{
action void A_PreSquish()
{
if ( Demolitionist(self) ) Demolitionist(self).lastgrin = gametic;
if ( Demolitionist(self) ) Demolitionist(self).facegrin = true;
}
action void A_Squish1()
{
@ -259,7 +259,7 @@ Class KirinPlushGesture : SWWMItemGesture
}
action void A_PreKiss()
{
if ( Demolitionist(self) ) Demolitionist(self).lastblink = gametic;
if ( Demolitionist(self) ) Demolitionist(self).faceblink = true;
}
action void A_PetPlush()
{

View file

@ -90,7 +90,7 @@ Class GrilledCheeseSandwich : Inventory
if ( (Owner.player == players[consoleplayer]) && (swwm_mutevoice < 2) )
{
SWWMHandler.AddOneliner("eat",2);
if ( Owner is 'Demolitionist' ) Demolitionist(Owner).lastgrin = gametic;
if ( Owner is 'Demolitionist' ) Demolitionist(Owner).facegrin = true;
}
DoTheThing();
return true;

View file

@ -1,5 +1,18 @@
// The Demolitionist
Enum EDemoFaceState
{
FS_DEFAULT,
FS_EVIL,
FS_GRIN,
FS_WINK,
FS_BLINK,
FS_SAD,
FS_PAIN,
FS_OUCH,
FS_DEAD // UNUSED
};
Class Demolitionist : PlayerPawn
{
int last_jump_held, last_boost, last_kick;
@ -88,12 +101,23 @@ Class Demolitionist : PlayerPawn
int invwipe; // inventory wipe flags for next level
transient int lastbang, lastgrin, lastsad, lastwink, lastblink;
transient int lastbang;
transient bool ingivecheat;
Property DashFuel : dashfuel;
EDemoFaceState facestate;
int paindir;
int facetimer;
int blinktime;
transient int oldfaceidx;
transient int rss;
transient bool facedamage, facegrin, facesad, facewink, faceblink;
transient CVar tagcolor;
transient int oldtagcolor;
Default
{
Tag "$T_DEMOLITIONIST";
@ -128,6 +152,156 @@ Class Demolitionist : PlayerPawn
+DONTDRAIN;
+DONTCORPSE;
}
private int GetRandom()
{
return (rss = (rss<<1)*35447+(rss/87));
}
private void UpdateTags()
{
if ( !tagcolor ) tagcolor = CVar.GetCVar('swwm_tagcolor',player);
static const String colname[] =
{
"",
"Blue",
"Cyan",
"Dragonfly",
"Gold",
"Magenta",
"Orange",
"Peach",
"Pink",
"Purple",
"Red",
"Violet",
"White",
"Yellow"
};
int idx = tagcolor.GetInt();
if ( (idx < 0) || (idx >= colname.Size()) ) idx = 0;
if ( idx != oldtagcolor )
A_ChangeModel("",0,"models","DemolitionistPlayer_d.3d",0,"models","DemoTags"..colname[idx]..".png",CMDL_USESURFACESKIN,0);
oldtagcolor = idx;
}
private void UpdateFace()
{
// damage handling
if ( facedamage )
{
if ( lastdamage > 70 )
{
facestate = FS_OUCH;
facetimer = (lastdamagetimer-gametic)+10;
}
else if ( facestate < FS_OUCH )
{
facestate = FS_PAIN;
facetimer = (lastdamagetimer-gametic)+10;
paindir = 0;
// paraphrased from vanilla, with some tweaks
if ( player.attacker && (player.attacker != self) )
{
double atkang = AngleTo(player.attacker);
double angdiff = deltaangle(angle,atkang);
if ( abs(angdiff) < 135 )
{
if ( angdiff > 45 ) paindir = -1;
else if ( angdiff < -45 ) paindir = 1;
}
}
}
}
facedamage = false;
if ( facegrin && (facestate < FS_SAD) )
{
facestate = FS_GRIN;
facetimer = 50;
}
facegrin = false;
if ( facewink && (facestate < FS_SAD) )
{
facestate = FS_WINK;
facetimer = 20;
}
facewink = false;
if ( faceblink && (facestate < FS_PAIN) )
{
facestate = FS_BLINK;
facetimer = 30;
}
faceblink = false;
if ( facesad && (facestate <= FS_SAD) )
{
facestate = FS_SAD;
facetimer = 50;
}
facesad = false;
if ( FindInventory("RagekitPower") && (facestate < FS_PAIN) )
{
facestate = FS_EVIL;
facetimer = 10;
}
if ( facetimer > 0 )
{
facetimer--;
if ( facetimer <= 0 )
{
facestate = FS_DEFAULT;
blinktime = 30;
}
}
if ( !(gametic&1) )
{
if ( blinktime <= 0 )
{
blinktime--;
if ( blinktime < -3 )
{
rss = int(MSTimeF());
blinktime = (abs(GetRandom())%10)?(40+abs(GetRandom())%40):6;
}
}
else blinktime--;
}
// update our face texture if different
static const String facetex[] =
{
"Blank", "Blink", "Booty", "Dead",
"Default", "Dizzy", "Evil", "Grin",
"Hurt", "HurtLeft", "HurtRight",
"Off", "Ouch", "Sad", "Smug",
"Unamused", "Wink"
};
int faceidx = GetFaceTex();
if ( !oldfaceidx || (faceidx != oldfaceidx) )
A_ChangeModel("",0,"models","DemolitionistPlayer_d.3d",1,"models","DemoFace_"..facetex[faceidx]..".png",CMDL_USESURFACESKIN,0);
oldfaceidx = faceidx;
}
private int GetFaceTex()
{
if ( player.Health <= 0 ) return 3;
if ( (bInvulnerable || (player.cheats&(CF_GODMODE|CF_GODMODE2)) || FindInventory("InvinciballPower")) && (facestate >= FS_PAIN) ) return 14;
if ( facestate == FS_OUCH ) return 12;
if ( facestate == FS_PAIN ) return (paindir==1)?10:(paindir==-1)?9:8;
if ( facestate == FS_GRIN ) return 7;
if ( facestate == FS_EVIL ) return 6;
if ( facestate == FS_SAD ) return 13;
if ( facestate == FS_WINK ) return 16;
if ( facestate == FS_BLINK ) return ((facetimer>28)||(facetimer<2))?15:1;
switch ( blinktime )
{
case -1:
case -3:
return 15;
break;
case -2:
return 1;
break;
}
return 4;
}
// oof
Vector2 NormalizedMove()
{
@ -399,6 +573,7 @@ Class Demolitionist : PlayerPawn
{
Super.PostBeginPlay();
lastground = true; // prevent sudden landing sound on map start
blinktime = 30;
// swap ourselves for a voodoo doll
if ( !player || (player.mo != self) )
{
@ -944,6 +1119,8 @@ Class Demolitionist : PlayerPawn
PoisonDamageReceived = 0;
Super.Tick();
if ( (gamestate != GS_LEVEL) || !player || (player.mo != self) ) return;
UpdateFace();
UpdateTags();
if ( hasteleported )
{
// we just got teleported, don't count the travel distance
@ -1742,6 +1919,7 @@ Class Demolitionist : PlayerPawn
PainChance = oldpchance;
if ( (Health <= 0) && (source == self) && (flags&DMG_EXPLOSION) )
SWWMUtility.MarkAchievement("dime",player);
facedamage = true;
return realdmg;
}
override void CalcHeight()
@ -2278,6 +2456,7 @@ Class Demolitionist : PlayerPawn
player.damagecount = 0;
player.bonuscount = 0;
player.poisoncount = 0;
blinktime = 30;
SetState(FindState("Spawn")+1); // skip tweening
roll = 0;
let s = Spawn("DemolitionistShockwave",pos);
@ -2772,7 +2951,7 @@ Class Demolitionist : PlayerPawn
{
Console.Printf(StringTable.Localize("$SWWM_LASTSECRET"),score);
SWWMHandler.AddOneliner("findsecret",2,40);
lastgrin = gametic;
facegrin = true;
}
else Console.Printf(StringTable.Localize("$SWWM_LASTSECRETREM"),player.GetUserName(),score);
SWWMUtility.AchievementProgressInc("allsecrets",1,player);
@ -2781,7 +2960,7 @@ Class Demolitionist : PlayerPawn
{
Console.Printf(StringTable.Localize("$SWWM_FINDSECRET"),score);
SWWMHandler.AddOneliner("findsecret",2,40);
lastgrin = gametic;
facegrin = true;
}
else Console.Printf(StringTable.Localize("$SWWM_FINDSECRETREM"),player.GetUserName(),score);
SWWMCredits.Give(player,score);
@ -2826,7 +3005,7 @@ Class Demolitionist : PlayerPawn
SWWMHandler.AddOneliner("getweapon",2);
}
else SWWMHandler.AddOneliner("getweapon",2);
lastgrin = gametic;
facegrin = true;
}
}
if ( (item is 'Key') && !key_reentrant && !deathmatch && !bInDefaultInventory )
@ -2847,7 +3026,7 @@ Class Demolitionist : PlayerPawn
SWWMHandler.AddOneliner("keyget",2);
}
else SWWMHandler.AddOneliner("keyget",2);
lastgrin = gametic;
facegrin = true;
}
// share all keys in mp
for ( int i=0; i<MAXPLAYERS; i++ )
@ -2867,7 +3046,7 @@ Class Demolitionist : PlayerPawn
if ( !ingivecheat )
{
SWWMHandler.AddOneliner(SWWMCollectible(item).GetLine,2);
lastgrin = gametic;
facegrin = true;
}
if ( !mystats ) return;
let cls = item.GetClass();
@ -2879,7 +3058,7 @@ Class Demolitionist : PlayerPawn
{
mystats.gotyorick = true;
SWWMHandler.AddOneliner("skullget",2);
lastgrin = gametic;
facegrin = true;
}
// notify key obtained to flash icon
if ( item is 'Key' )
@ -3116,6 +3295,7 @@ Class Demolitionist : PlayerPawn
last_boost = 0;
last_kick = 0;
hasrevived = false;
blinktime = 30;
// cancel dash/boost
A_StopSound(CHAN_JETPACK);
fuelcooldown = 0.;
@ -3455,34 +3635,34 @@ Class Demolitionist : PlayerPawn
Approve:
#### # 3;
XZW5 NOPQR 3;
XZW5 S 3 { lastgrin = gametic; }
XZW5 S 3 { facegrin = true; }
XZW5 TUVWXYZ 3;
XZW6 ABCD 3;
Goto Spawn+1;
Victory:
#### # 3;
XZW6 EFGH 3;
XZW6 I 3 { lastgrin = gametic; }
XZW6 I 3 { facegrin = true; }
XZW6 JKLMNOPQRSTUVW 3;
Goto Spawn+1;
BlowKiss:
#### # 3;
XZWD EFGH 3;
XZWD I 3 { lastblink = gametic; }
XZWD I 3 { faceblink = true; }
XZWD JKLMNO 3;
XZWD P 3 { lastwink = gametic; }
XZWD P 3 { facewink = true; }
XZWD QRSTUVW 3;
Goto Spawn+1;
Headpat:
#### # 3;
XZWH ST 3;
XZWH U 2;
XZWH V 2 { lastgrin = gametic; }
XZWH V 2 { facegrin = true; }
XZWH W 2;
XZWH XYZ 1;
XZWI A 1;
XZWI B 2;
XZWI C 2 { lastgrin = gametic; }
XZWI C 2 { facegrin = true; }
XZWI DE 2;
XZWI FG 1;
HeadpatLoop:
@ -3490,7 +3670,7 @@ Class Demolitionist : PlayerPawn
XZWH XYZ 1;
XZWI A 1;
XZWI B 2;
XZWI C 2 { lastgrin = gametic; }
XZWI C 2 { facegrin = true; }
XZWI DE 2;
XZWI FGH 1;
XZWI IJK 2;
@ -3588,23 +3768,23 @@ Class Demolitionist : PlayerPawn
CrouchApprove:
#### # 3;
XZWF PQRST 3;
XZWF U 3 { lastgrin = gametic; }
XZWF U 3 { facegrin = true; }
XZWF VWXYZ 3;
XZWG ABCDEF 3;
Goto Crouch+1;
CrouchVictory:
#### # 3;
XZWG GHIJ 3;
XZWG K 3 { lastgrin = gametic; }
XZWG K 3 { facegrin = true; }
XZWG LMNOPQRSTUVWXY 3;
Goto Crouch+1;
CrouchBlowKiss:
#### # 3;
XZWG Z 3;
XZWH ABC 3;
XZWH D 3 { lastblink = gametic; }
XZWH D 3 { faceblink = true; }
XZWH EFGHIJ 3;
XZWH K 3 { lastwink = gametic; }
XZWH K 3 { facewink = true; }
XZWH LMNOPQR 3;
Goto Crouch+1;
CrouchMissile:

View file

@ -510,20 +510,13 @@ Class DemolitionistSelfLight : Thinker
{
bool oldactive;
bool oldglow;
transient Color tagcolor;
Actor target;
transient CVar tagcolor;
bool activelight()
{
// active all the time except when invisible or in certain
// animation frames
// active all the time except when invisible
if ( target.bINVISIBLE || (target.alpha <= double.epsilon) ) return false;
if ( target.InStateSequence(target.CurState,target.FindState("Death")) && ((target.frame == 20) || (target.frame == 22) || (target.frame == 23) || (target.frame == 25) || (target.frame == 27) || (target.frame == 28) || (target.frame == 30) || (target.frame == 31) || (target.frame == 32) || (target.frame == 33) || (target.frame == 34)) )
return false;
if ( target.InStateSequence(target.CurState,target.FindState("CrouchDeath")) && ((target.frame == 7) || (target.frame == 10) || (target.frame == 11)) )
return false;
if ( target.InStateSequence(target.CurState,target.FindState("VoodooDeath")) && ((target.frame == 9) || (target.frame == 11) || (target.frame == 12) || (target.frame == 14) || (target.frame == 16) || (target.frame == 18)) )
return false;
return true;
}
override void Tick()
@ -533,18 +526,26 @@ Class DemolitionistSelfLight : Thinker
Destroy();
return;
}
if ( tagcolor.a == 0 )
if ( !tagcolor ) tagcolor = CVar.GetCVar('swwm_tagcolor',target.player);
static const Color litecolor[] =
{
let lmp = Wads.FindLump("tagcolor.txt");
if ( lmp != -1 )
{
String str = Wads.ReadLump(lmp);
Array<String> rgb;
str.Split(rgb,",",0);
tagcolor = Color(255,rgb[0].ToInt(),rgb[1].ToInt(),rgb[2].ToInt());
}
else tagcolor = Color(255,32,48,24);
}
Color(255,32,48,24), // Green
Color(255,24,24,48), // Blue
Color(255,24,48,48), // Cyan
Color(255,24,48,32), // Dragonfly
Color(255,48,40,24), // Gold
Color(255,48,24,48), // Magenta
Color(255,48,32,24), // Orange
Color(255,48,40,32), // Peach
Color(255,48,32,40), // Pink
Color(255,32,24,48), // Purple
Color(255,48,24,24), // Red
Color(255,32,24,48), // Violet
Color(255,48,48,48), // White
Color(255,48,48,24) // Yellow
};
int idx = tagcolor.GetInt();
if ( (idx < 0) || (idx >= litecolor.Size()) ) idx = 0;
bool doselflight = swwm_selflight;
bool curactive = doselflight&&activelight();
// setting the pitch to a value outside [-90,90] makes it auto-update to the actor's own pitch
@ -556,7 +557,7 @@ Class DemolitionistSelfLight : Thinker
target.A_AttachLight('DemoSelfLight',DynamicLight.PointLight,0,0,0);
oldactive = curactive;
bool curglow = doselflight&&(!(target.bINVISIBLE||(target.alpha <= double.epsilon)));
if ( curglow && !oldglow ) target.A_AttachLight('DemoSelfLight2',DynamicLight.PointLight,tagcolor,80,0,DynamicLight.LF_DONTLIGHTSELF|DynamicLight.LF_ATTENUATE,(0,0,target.height/2));
if ( curglow && !oldglow ) target.A_AttachLight('DemoSelfLight2',DynamicLight.PointLight,litecolor[idx],80,0,DynamicLight.LF_DONTLIGHTSELF|DynamicLight.LF_ATTENUATE,(0,0,target.height/2));
else if ( !curglow && oldglow ) target.A_AttachLight('DemoSelfLight2',DynamicLight.PointLight,0,0,0);
oldglow = curglow;
}

View file

@ -63,7 +63,7 @@ Class ExplodiumGun : SWWMWeapon
if ( demo && demo.mystats && !demo.mystats.GotWeapon(SisterWeapon.GetClass()) && (Owner.player == players[consoleplayer]) && !demo.ingivecheat )
{
SWWMHandler.AddOneliner(SWWMWeapon(SisterWeapon).GetLine,2);
demo.lastgrin = gametic;
demo.facegrin = true;
}
item.bPickupGood = true;
}