// collectible items that may drop sometimes Class SWWMCollectible : Inventory abstract { Mixin SWWMUseToPickup; int avail; bool propagated; Class gesture; Property Availability : avail; Property GestureWeapon : gesture; // minimum gametype requirements enum EAvailability { AVAIL_Hexen, AVAIL_Heretic, AVAIL_Eviternity, AVAIL_All }; Default { Inventory.PickupSound "menu/buyinv"; Inventory.Amount 1; Inventory.MaxAmount 1; Inventory.PickupFlash "SWWMCyanPickupFlash"; SWWMCollectible.Availability AVAIL_All; +INVENTORY.UNTOSSABLE; +INVENTORY.UNDROPPABLE; +INVENTORY.UNCLEARABLE; +INVENTORY.AUTOACTIVATE; +FLOATBOB; +DONTGIB; FloatBobStrength 0.25; Radius 8; Height 24; } bool ValidGame() const { if ( avail == AVAIL_All ) return true; if ( (avail == AVAIL_Eviternity) && ((gameinfo.gametype&GAME_Raven) || SWWMUtility.IsEviternity()) ) return true; if ( (avail == AVAIL_Heretic) && (gameinfo.gametype&GAME_Raven) ) return true; if ( (avail == AVAIL_Hexen) && (gameinfo.gametype&GAME_Hexen) ) return true; return false; } override void PostBeginPlay() { Super.PostBeginPlay(); // delet ourselves if wrong iwad if ( !ValidGame() ) Destroy(); } override bool CanPickup( Actor toucher ) { // no pickup if wrong iwad if ( !ValidGame() ) return false; return Super.CanPickup(toucher); } override string PickupMessage() { if ( Stamina > 0 ) return StringTable.Localize(PickupMsg)..String.Format(" \cj(\cg„\cf%d\cj)\c-",Stamina); return Super.PickupMessage(); } override bool Use( bool pickup ) { if ( Owner.player && !propagated ) { if ( pickup && CVar.GetCVar('swwm_collectanim',Owner.player).GetBool() ) SWWMGesture.SetSpecialGesture(Owner.player.mo,gesture); else if ( !pickup ) SWWMGesture.SetSpecialGesture(Owner.player.mo,gesture,true); } // clean up the flag propagated = false; return false; } override void AttachToOwner( Actor other ) { Super.AttachToOwner(other); // we're only attaching to the other players if ( propagated ) return; // 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)); SWWMCredits.Give(other.player,Stamina); } // send to all other players for ( int i=0; i