diff --git a/cvarinfo.base b/cvarinfo.base index 7da4c513d..4826c9cdb 100644 --- a/cvarinfo.base +++ b/cvarinfo.base @@ -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 diff --git a/gldefs.demolitionist b/gldefs.demolitionist index eab29af77..51e4b4f31 100644 --- a/gldefs.demolitionist +++ b/gldefs.demolitionist @@ -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" +} diff --git a/language.def_menu b/language.def_menu index 38c048c6a..eef996e72 100644 --- a/language.def_menu +++ b/language.def_menu @@ -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."; diff --git a/language.es_menu b/language.es_menu index 47bce1909..cc840b3c5 100644 --- a/language.es_menu +++ b/language.es_menu @@ -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."; diff --git a/language.version b/language.version index f95e20112..22dbecc48 100644 --- a/language.version +++ b/language.version @@ -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-"; diff --git a/menudef.txt b/menudef.txt index 20826dbbc..80c147229 100644 --- a/menudef.txt +++ b/menudef.txt @@ -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" diff --git a/modeldef.demolitionist b/modeldef.demolitionist index 6d63ded14..d992b2e61 100644 --- a/modeldef.demolitionist +++ b/modeldef.demolitionist @@ -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 diff --git a/models/DemoTagsBlue.png b/models/DemoTagsBlue.png new file mode 100644 index 000000000..1b1643937 Binary files /dev/null and b/models/DemoTagsBlue.png differ diff --git a/models/DemoTagsCyan.png b/models/DemoTagsCyan.png new file mode 100644 index 000000000..7018ae42d Binary files /dev/null and b/models/DemoTagsCyan.png differ diff --git a/models/DemoTagsDragonfly.png b/models/DemoTagsDragonfly.png new file mode 100644 index 000000000..f950538eb Binary files /dev/null and b/models/DemoTagsDragonfly.png differ diff --git a/models/DemoTagsGold.png b/models/DemoTagsGold.png new file mode 100644 index 000000000..0e1dd1955 Binary files /dev/null and b/models/DemoTagsGold.png differ diff --git a/models/DemoTagsMagenta.png b/models/DemoTagsMagenta.png new file mode 100644 index 000000000..6115e9803 Binary files /dev/null and b/models/DemoTagsMagenta.png differ diff --git a/models/DemoTagsOrange.png b/models/DemoTagsOrange.png new file mode 100644 index 000000000..91c4eb6a2 Binary files /dev/null and b/models/DemoTagsOrange.png differ diff --git a/models/DemoTagsPeach.png b/models/DemoTagsPeach.png new file mode 100644 index 000000000..826eb3d14 Binary files /dev/null and b/models/DemoTagsPeach.png differ diff --git a/models/DemoTagsPink.png b/models/DemoTagsPink.png new file mode 100644 index 000000000..333a6f33e Binary files /dev/null and b/models/DemoTagsPink.png differ diff --git a/models/DemoTagsPurple.png b/models/DemoTagsPurple.png new file mode 100644 index 000000000..4bc806b5b Binary files /dev/null and b/models/DemoTagsPurple.png differ diff --git a/models/DemoTagsRed.png b/models/DemoTagsRed.png new file mode 100644 index 000000000..a7354f60b Binary files /dev/null and b/models/DemoTagsRed.png differ diff --git a/models/DemoTagsViolet.png b/models/DemoTagsViolet.png new file mode 100644 index 000000000..79a716dfd Binary files /dev/null and b/models/DemoTagsViolet.png differ diff --git a/models/DemoTagsWhite.png b/models/DemoTagsWhite.png new file mode 100644 index 000000000..9f295208e Binary files /dev/null and b/models/DemoTagsWhite.png differ diff --git a/models/DemoTagsYellow.png b/models/DemoTagsYellow.png new file mode 100644 index 000000000..1a85657a8 Binary files /dev/null and b/models/DemoTagsYellow.png differ diff --git a/zscript/handler/swwm_handler_damage.zsc b/zscript/handler/swwm_handler_damage.zsc index 6f57f71ab..cc707a53c 100644 --- a/zscript/handler/swwm_handler_damage.zsc +++ b/zscript/handler/swwm_handler_damage.zsc @@ -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 { diff --git a/zscript/handler/swwm_handler_oneliners.zsc b/zscript/handler/swwm_handler_oneliners.zsc index e4804f070..52913690b 100644 --- a/zscript/handler/swwm_handler_oneliners.zsc +++ b/zscript/handler/swwm_handler_oneliners.zsc @@ -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; diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index 386de3a6e..b757a6844 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -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); } diff --git a/zscript/items/swwm_collectibles_gesture.zsc b/zscript/items/swwm_collectibles_gesture.zsc index baac44e2c..505512889 100644 --- a/zscript/items/swwm_collectibles_gesture.zsc +++ b/zscript/items/swwm_collectibles_gesture.zsc @@ -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() { diff --git a/zscript/items/swwm_powerups.zsc b/zscript/items/swwm_powerups.zsc index f846f93e6..9b2645cc1 100644 --- a/zscript/items/swwm_powerups.zsc +++ b/zscript/items/swwm_powerups.zsc @@ -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; diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index 914d6544b..5832dce92 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -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 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; } diff --git a/zscript/weapons/swwm_splode.zsc b/zscript/weapons/swwm_splode.zsc index fc977532e..02209c40f 100644 --- a/zscript/weapons/swwm_splode.zsc +++ b/zscript/weapons/swwm_splode.zsc @@ -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; }