diff --git a/language.version b/language.version index a695252c6..1cae2e841 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r496 \cu(Fri 23 Sep 22:27:45 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.3pre r496 \cu(2022-09-23 22:27:45)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r497 \cu(Sat 24 Sep 01:21:03 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.3pre r497 \cu(2022-09-24 01:21:03)\c-"; diff --git a/textures/DefaultTexture.png b/textures/DefaultTexture.png new file mode 100644 index 000000000..1442f7ce2 Binary files /dev/null and b/textures/DefaultTexture.png differ diff --git a/zscript/handler/swwm_handler_damage.zsc b/zscript/handler/swwm_handler_damage.zsc index 788fde7d1..760f46743 100644 --- a/zscript/handler/swwm_handler_damage.zsc +++ b/zscript/handler/swwm_handler_damage.zsc @@ -117,6 +117,7 @@ extend Class SWWMHandler // combat hit chatter private void DoCombatHit( WorldEvent e ) { + if ( (e.DamageSource is 'SWWMVoodooDoll') || (e.Thing is 'SWWMVoodooDoll') ) return; if ( (e.DamageSource.bISMONSTER || e.DamageSource.player || (e.DamageSource is 'ScriptedMarine')) && (e.Thing == players[consoleplayer].mo) && (e.Thing.Health > 0) ) { if ( !lastcombat || (gametic > lastcombat+20) ) @@ -160,7 +161,7 @@ extend Class SWWMHandler s.kills++; s.AddWeaponKill(inflictor,e.Thing,e.DamageType); } - if ( src == players[consoleplayer].mo ) + if ( (src == players[consoleplayer].mo) && !(e.Thing is 'SWWMVoodooDoll') ) { highesttic = gametic; if ( !lastcombat || (gametic > lastcombat+20) ) diff --git a/zscript/hud/swwm_hud.zsc b/zscript/hud/swwm_hud.zsc index d4ffb79c2..52d842d29 100644 --- a/zscript/hud/swwm_hud.zsc +++ b/zscript/hud/swwm_hud.zsc @@ -1491,10 +1491,10 @@ Class SWWMStatusBar : BaseStatusBar } // ignore unowned (can happen?) if ( !ct.Owner ) continue; - // ignore player trackers - if ( ct.Owner.player ) continue; + // ignore player trackers unless voodoo dolls + if ( ct.Owner.player && (ct.Owner.player.mo == ct.Owner) ) continue; // ignore local player or camera - if ( (ct.Owner.player == CPlayer) || (ct.Owner == cam) ) continue; + if ( (ct.Owner == CPlayer.mo) || (ct.Owner == cam) ) continue; // ignore trackers not of this player if ( ct.myplayer != CPlayer ) continue; // ignore trackers clearly outside of player view @@ -1523,7 +1523,8 @@ Class SWWMStatusBar : BaseStatusBar if ( swwm_bigtags ) tag = "\cx★\c- "..tag.." \cx★\c-"; else tag = "\cx*\c- "..tag.." \cx*\c-"; // miniwi has no stars } - if ( ct.Owner.IsFriend(CPlayer.mo) ) tag = "\cg♥\c- "..tag.." \cg♥\c-"; + // voodoo dolls aren't friends + if ( ct.Owner.IsFriend(CPlayer.mo) && !ct.Owner.player ) tag = "\cg♥\c- "..tag.." \cg♥\c-"; Screen.DrawText(fnt,Font.CR_WHITE,vpos.x-fnt.StringWidth(tag)/2,barpos.y-(fnt.GetHeight()+2),tag,DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,alph); } Screen.DrawTexture(EnemyBTex,false,barpos.x,barpos.y,DTA_VirtualWidthF,ss1.x,DTA_VirtualHeightF,ss1.y,DTA_KeepRatio,true,DTA_Alpha,alph); @@ -1554,10 +1555,10 @@ Class SWWMStatusBar : BaseStatusBar } // ignore unowned (can happen?) if ( !ct.Owner ) continue; - // ignore non-player trackers - if ( !ct.Owner.player ) continue; + // ignore non-player trackers and voodoo dolls + if ( !ct.Owner.player || (ct.Owner.player.mo != ct.Owner) ) continue; // ignore local player or camera - if ( (ct.Owner.player == CPlayer) || (ct.Owner == cam) ) continue; + if ( (ct.Owner == CPlayer.mo) || (ct.Owner == cam) ) continue; // ignore trackers not of this player if ( ct.myplayer != CPlayer ) continue; // ignore trackers clearly outside of player view diff --git a/zscript/swwm_common.zsc b/zscript/swwm_common.zsc index f14403871..498f3a57c 100644 --- a/zscript/swwm_common.zsc +++ b/zscript/swwm_common.zsc @@ -231,6 +231,22 @@ Class SWWMQuickCombatTracker : Inventory else mytag = ""; } + override void AttachToOwner( Actor other ) + { + // GROSS HACK TO ATTACH TO VOODOO DOLLS + if ( other.player && (other.player.mo != other) ) + { + BecomeItem(); + Owner = other; + inv = Owner.inv; + Owner.inv = self; + // we unfortunately can't access this, but hopefully it shouldn't be necessary + //InventoryID = Owner.InventoryID++; + return; + } + Super.AttachToOwner(other); + } + static SWWMQuickCombatTracker Update( SWWMHandler hnd, PlayerInfo p, Actor target, int damage = 0 ) { // no-damage entities get no healthbars diff --git a/zscript/swwm_player.zsc b/zscript/swwm_player.zsc index a2442652d..6bae67955 100644 --- a/zscript/swwm_player.zsc +++ b/zscript/swwm_player.zsc @@ -151,6 +151,7 @@ Class Demolitionist : PlayerPawn +NOBLOOD; +DONTGIB; +NOICEDEATH; + +NOSKIN; +DONTMORPH; +DONTDRAIN; +DONTCORPSE; @@ -4005,6 +4006,7 @@ Class SWWMVoodooDoll : PlayerPawn +DONTGIB; +NOICEDEATH; +DONTCORPSE; + +NOSKIN; -FRIENDLY; } States diff --git a/zscript/swwm_player_items.zsc b/zscript/swwm_player_items.zsc index 4ab32db1f..eb0e87a3f 100644 --- a/zscript/swwm_player_items.zsc +++ b/zscript/swwm_player_items.zsc @@ -53,7 +53,7 @@ Class SayaCollar : SWWMArmor override void ModifyDamage( int damage, Name damageType, out int newdamage, bool passive, Actor inflictor, Actor source, int flags ) { int ff = swwm_friendlyfire; - if ( !source || (source == Owner) || !source.IsFriend(Owner) || !ff ) return; + if ( !source || (source == Owner) || (source.player == Owner.player) || !source.IsFriend(Owner) || !ff ) return; // 1: block incoming friendly damage // 2: also block outgoing friendly damage if ( (passive && ff) || (!passive && (ff == 2)) )