swwmgz_m/zscript/items/swwm_collectibles.zsc
2021-08-12 16:29:51 +02:00

356 lines
7.5 KiB
Text

// collectible items that may drop sometimes
Class SWWMCollectible : Inventory abstract
{
Mixin SWWMUseToPickup;
int avail;
bool propagated;
Class<SWWMItemGesture> gesture;
Property Availability : avail;
Property GestureWeapon : gesture;
// minimum gametype requirements
enum EAvailability
{
AVAIL_None,
AVAIL_All,
AVAIL_Heretic,
AVAIL_Hexen
};
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;
+INVENTORY.NEVERRESPAWN;
+FLOATBOB;
+DONTGIB;
FloatBobStrength 0.25;
Radius 8;
Height 24;
}
bool ValidGame() const
{
if ( avail == AVAIL_None ) return false;
if ( avail == AVAIL_All ) 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 bool ShouldSpawn()
{
// don't spawn in-game if on deathmatch or the wrong IWAD
if ( deathmatch || !ValidGame() ) return false;
return true;
}
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 && (!pickup || CVar.GetCVar('swwm_collectanim',Owner.player).GetBool()) )
SWWMGesture.SetSpecialGesture(Owner.player.mo,gesture);
// clean up the flag
propagated = false;
return false;
}
override void AttachToOwner( Actor other )
{
Super.AttachToOwner(other);
// count how many we have, set progress accordingly
int nc = 0, cnc = 0;
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
let c = (Class<SWWMCollectible>)(AllActorClasses[i]);
if ( !c || (c == 'SWWMCollectible') ) continue;
let def = GetDefaultByType(c);
// check that we can collect it in this IWAD
if ( !def.ValidGame() ) continue;
nc++;
}
for ( Inventory i=other.inv; i; i=i.inv )
{
if ( !(i is 'SWWMCollectible') ) continue;
cnc++;
}
SWWMUtility.AchievementProgress('swwm_progress_allcoll',cnc,other.player);
// 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<MAXPLAYERS; i++ )
{
if ( !playeringame[i] || !players[i].mo || (i == other.PlayerNumber()) )
continue;
let c = SWWMCollectible(Spawn(GetClass(),pos));
c.propagated = true;
if ( !c.CallTryPickup(players[i].mo) )
c.Destroy();
}
}
States
{
Spawn:
XZW1 A -1;
Stop;
}
}
// The collectibles
Class GenericCube : SWWMCollectible
{
Default
{
Tag "$T_PERFECTLYGENERIC";
Inventory.PickupMessage "$T_PERFECTLYGENERIC";
SWWMCollectible.GestureWeapon "GenericCubeGesture";
Stamina 1000;
}
}
Class AkariProject : SWWMCollectible
{
Default
{
Tag "$T_AKARIPROJECT";
Inventory.PickupMessage "$T_AKARIPROJECT";
SWWMCollectible.GestureWeapon "AkariProjectGesture";
Stamina 2000;
Radius 4;
Height 22;
}
}
Class LoveSignalsCD : SWWMCollectible
{
Default
{
Tag "$T_LOVESIGNALS";
Inventory.PickupMessage "$T_LOVESIGNALS";
SWWMCollectible.GestureWeapon "LoveSignalsCDGesture";
Stamina 3000;
Radius 4;
Height 21;
}
}
Class NutatcoBar : SWWMCollectible
{
Default
{
Tag "$T_NUTATCO";
Inventory.PickupMessage "$T_NUTATCO";
SWWMCollectible.GestureWeapon "NutatcoBarGesture";
Stamina 200;
Radius 3;
Height 22;
}
}
Class FrispyCorn : SWWMCollectible
{
Default
{
Tag "$T_FRISPYCORN";
Inventory.PickupMessage "$T_FRISPYCORN";
SWWMCollectible.GestureWeapon "FrispyCornGesture";
Stamina 400;
Radius 5;
Height 23;
}
}
Class SayaBean : SWWMCollectible
{
bool callout; // already called the player a perv for loading h-doom
Default
{
Tag "$T_SAYABEAN";
Inventory.PickupMessage "$T_SAYABEAN";
SWWMCollectible.GestureWeapon "SayaBeanGesture";
Stamina 5000;
Radius 6;
Height 23;
}
}
Class MothPlushy : SWWMCollectible
{
Default
{
Tag "$T_MOTHPLUSH";
Inventory.PickupMessage "$T_MOTHPLUSH";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "MothPlushyGesture";
Stamina 7000;
}
}
Class AA12Model : SWWMCollectible
{
Default
{
Tag "$T_AA12";
Inventory.PickupMessage "$T_AA12";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "AA12ModelGesture";
Stamina 10000;
}
}
Class CactusHege : SWWMCollectible
{
Default
{
Tag "$T_HEGE";
Inventory.PickupMessage "$T_HEGE";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "CactusHegeGesture";
Stamina 3000;
}
}
Class TastyHoagie : SWWMCollectible
{
Default
{
Tag "$T_HOAGIE";
Inventory.PickupMessage "$T_HOAGIE";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "TastyHoagieGesture";
Stamina 2000;
}
}
Class IbukiMilk : SWWMCollectible
{
Default
{
Tag "$T_IBUKIMILK";
Inventory.PickupMessage "$T_IBUKIMILK";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "IbukiMilkGesture";
Stamina 800;
}
}
Class BRCAlbum : SWWMCollectible
{
Default
{
Tag "$T_BRCALBUM";
Inventory.PickupMessage "$T_BRCALBUM";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "BRCAlbumGesture";
Stamina 4000;
}
}
// Heretic
Class DemoPlush : SWWMCollectible
{
Default
{
Tag "$T_DEMOPLUSH";
Inventory.PickupMessage "$T_DEMOPLUSH";
SWWMCollectible.Availability AVAIL_Heretic;
SWWMCollectible.GestureWeapon "DemoPlushGesture";
Stamina 6000;
Radius 12;
Height 36;
}
}
Class Manarokou : SWWMCollectible
{
Default
{
Tag "$T_MANAROKOU";
Inventory.PickupMessage "$T_MANAROKOU";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "ManarokouGesture";
Stamina 9000;
}
}
Class LithiumNovel : SWWMCollectible
{
Default
{
Tag "$T_LITHIUM";
Inventory.PickupMessage "$T_LITHIUM";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "LithiumNovelGesture";
Stamina 2000;
}
}
// Hexen
Class KirinCummies : SWWMCollectible
{
Default
{
Tag "$T_PEACH";
Inventory.PickupMessage "$T_PEACH";
SWWMCollectible.Availability AVAIL_Hexen;
SWWMCollectible.GestureWeapon "KirinCummiesGesture";
Stamina 300;
Radius 3;
Height 21;
}
}
Class MilkBreads : SWWMCollectible
{
Default
{
Tag "$T_MILKBREAD";
Inventory.PickupMessage "$T_MILKBREAD";
SWWMCollectible.Availability AVAIL_Hexen;
SWWMCollectible.GestureWeapon "MilkBreadsGesture";
Stamina 900;
Radius 4;
Height 21;
}
}
Class KirinManga : SWWMCollectible
{
Default
{
Tag "$T_KIRINMANGA";
Inventory.PickupMessage "$T_KIRINMANGA";
SWWMCollectible.Availability AVAIL_Hexen;
SWWMCollectible.GestureWeapon "KirinMangaGesture";
Stamina 1600;
Radius 4;
Height 22;
}
}
Class KirinPlush : SWWMCollectible
{
Default
{
Tag "$T_KIRINPLUSH";
Inventory.PickupMessage "$T_KIRINPLUSH";
SWWMCollectible.Availability AVAIL_Hexen;
SWWMCollectible.GestureWeapon "KirinPlushGesture";
Stamina 8000;
Radius 14;
Height 37;
}
}
Class Psykkonovexx : SWWMCollectible
{
Default
{
Tag "$T_PSYKKONOVEXX";
Inventory.PickupMessage "$T_PSYKKONOVEXX";
SWWMCollectible.Availability AVAIL_None;
SWWMCollectible.GestureWeapon "PsykkonovexxGesture";
Stamina 15000;
}
}