Demoslayer mode now has "ammo orbs" as well.

This commit is contained in:
Mari the Deer 2022-08-12 11:15:09 +02:00
commit 7d6562c326
6 changed files with 75 additions and 46 deletions

View file

@ -273,7 +273,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resets weapon tooltips so you can see them al
TOOLTIP_EVENT_SWWMRESETCVARS = "Resets all the mod's settings to their original values.";
TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Erases all your archievement progress.";
TOOLTIP_SWWM_NOINTERTIPS = "Hides intermission tips, in case you don't want to see them.";
TOOLTIP_SWWM_DEMOSLAYER = "Killed enemies may drop health and armor orbs.";
TOOLTIP_SWWM_DEMOSLAYER = "Killed enemies may drop health, armor and ammo orbs.";
TOOLTIP_SWWM_BEEPBOOP = "The Demolitionist will make cute noises whenever pressing any usable line. This might get annoying, so it's optional.";
TOOLTIP_SWWM_VOICEAMP = "At their default volume, the Demolitionist's voice lines might be drowned out by in-game audio. This sets an additional amplification level so they're louder than other sounds.";
TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Fades out any active blood, gore, debris and casings.";

View file

@ -271,7 +271,7 @@ TOOLTIP_EVENT_SWWMRESETTOOLTIPS = "Resetea la ayuda de armas para que puedas vol
TOOLTIP_EVENT_SWWMRESETCVARS = "Resetea todas las opciones del mod a sus valores originales.";
TOOLTIP_EVENT_SWWMRESETACHIEVEMENTS = "Borra todo tu progreso de logros.";
TOOLTIP_SWWM_NOINTERTIPS = "Oculta los consejos de intermisión, por si no quieres verlos.";
TOOLTIP_SWWM_DEMOSLAYER = "Los enemigos que mates soltarán orbes de salud y armadura.";
TOOLTIP_SWWM_DEMOSLAYER = "Los enemigos que mates soltarán orbes de salud, armadura y munición.";
TOOLTIP_SWWM_BEEPBOOP = "La Demolicionista hará ruiditos adorables cuando pulse cualquier línea utilizable. Esto puede que resulte cansino, así que es opcional.";
TOOLTIP_SWWM_VOICEAMP = "A su volumen normal, las voces de la Demolicionista pueden ser ahogadas por el audio del juego. Con esto se le dá un nivel de amplificación extra para que sean más estridentes que otros sonidos.";
TOOLTIP_NETEVENT_SWWMCLEAREFFECTS = "Desvanece cualquier sangre, vísceras, escombros y casquillos activos.";

View file

@ -1,3 +1,3 @@
[default]
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r306 \cu(Fri 12 Aug 09:31:45 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r306 \cu(2022-08-12 09:31:45)\c-";
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r307 \cu(Fri 12 Aug 11:15:09 CEST 2022)\c-";
SWWM_SHORTVER="\cw1.3pre r307 \cu(2022-08-12 11:15:09)\c-";

View file

@ -218,6 +218,7 @@ extend Class SWWMHandler
if ( src.Health < 100 )
{
int amt = clamp(e.Thing.SpawnHealth()/20,1,10);
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
for ( int i=0; i<amt; i++ )
@ -231,7 +232,8 @@ extend Class SWWMHandler
}
if ( src.CountInv("ArmorNugget") < 100 )
{
int amt = clamp(e.Thing.SpawnHealth()/40,1,5);
int amt = clamp(e.Thing.SpawnHealth()/30,1,10);
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
for ( int i=0; i<amt; i++ )
@ -243,6 +245,28 @@ extend Class SWWMHandler
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,8);
}
}
bool needsammo = false;
for ( Inventory i=src.Inv; i; i=i.inv )
{
if ( !(i is 'SWWMAmmo') || (i.Stamina <= 0) || (i.Stamina > 50000) || (i.Amount >= i.MaxAmount) ) continue;
needsammo = true;
break;
}
if ( needsammo )
{
int amt = clamp(e.Thing.SpawnHealth()/40,1,10);
if ( e.Thing.bBOSS || e.Thing.FindInventory("BossMarker") ) amt *= 2;
if ( e.Thing.Health < (e.Thing.GetGibHealth()*2) ) amt *= 3;
else if ( e.Thing.Health < e.Thing.GetGibHealth() ) amt *= 2;
for ( int i=0; i<amt; i++ )
{
if ( Random[Junk](0,1) ) continue;
let a = Actor.Spawn("AmmoOrb",e.Thing.Vec3Offset(0,0,e.Thing.Height/2));
a.vel.z = FRandom[Junk](4,16);
double ang = FRandom[Junk](0,360);
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,8);
}
}
}
}
// no credits unless it's a counted kill or marine (that isn't friendly) or another player in DM

View file

@ -111,20 +111,6 @@ Class AmmoFabricator : Inventory abstract
bool FabricateAmmo()
{
// first we must build an array of all valid weapons, this saves time instead of doing recursive loops
Array<Class<Weapon> > validweapons;
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
let type2 = (class<Weapon>)(AllActorClasses[i]);
if ( !type2 ) continue;
let rep = GetReplacement(type2);
if ( (rep != type2) && !(rep is "DehackedPickup") ) continue;
readonly<Weapon> weap = GetDefaultByType(type2);
if ( !Owner.player || !Owner.player.weapons.LocateWeapon(type2) || weap.bCheatNotWeapon || !weap.CanPickup(Owner) ) continue;
let ready = weap.FindState("Ready");
if ( !ready || !ready.ValidateSpriteFrame() ) continue;
validweapons.Push(type2);
}
Array<Class<SWWMAmmo> > available;
// populate ammo production list
for ( int i=0; i<AllActorClasses.Size(); i++ )
@ -136,23 +122,6 @@ Class AmmoFabricator : Inventory abstract
if ( !a || (a.GetParentClass() != 'SWWMAmmo') ) continue;
let def = GetDefaultByType(a);
if ( (def.Stamina <= 0) || (def.Stamina > maxunitprice) ) continue;
// only ammo for weapons that are valid (can be used)
bool isvalid = false;
for ( int j=0; j<validweapons.Size(); j++ )
{
readonly<Weapon> weap = GetDefaultByType(validweapons[j]);
if ( (validweapons[j] is 'SWWMWeapon') && SWWMWeapon(weap).UsesAmmo(a) )
{
isvalid = true;
break;
}
if ( (weap.AmmoType1 == a) || (weap.AmmoType2 == a) )
{
isvalid = true;
break;
}
}
if ( !isvalid ) continue;
let f = Owner.FindInventory(a);
// don't include maxed out ammo
if ( f && (f.Amount >= f.MaxAmount) ) continue;
@ -228,7 +197,7 @@ Class AmmoFabricator : Inventory abstract
{
if ( FabricateAmmo() )
{
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
if ( pickup && ((Owner.player == players[consoleplayer]) || bBigPowerup) && !bQUIET ) Owner.A_StartSound(UseSound,CHAN_ITEMEXTRA);
return true;
}
return false;
@ -270,8 +239,8 @@ Class FabricatorTier1 : AmmoFabricator
Inventory.PickupMessage "$T_FABRICATOR1";
AmmoFabricator.Budget 3000;
AmmoFabricator.PerType 1;
AmmoFabricator.MaxUnits 1;
AmmoFabricator.MaxTypes 1;
AmmoFabricator.MaxUnits 2;
AmmoFabricator.MaxTypes 2;
AmmoFabricator.MaxUnitPrice 2500;
AmmoFabricator.ChanceFactor 1;
AmmoFabricator.TextColor Font.CR_BLUE;
@ -286,9 +255,9 @@ Class FabricatorTier2 : AmmoFabricator
Tag "$T_FABRICATOR2";
Inventory.PickupMessage "$T_FABRICATOR2";
AmmoFabricator.Budget 20000;
AmmoFabricator.PerType 1;
AmmoFabricator.MaxUnits 2;
AmmoFabricator.MaxTypes 2;
AmmoFabricator.PerType 2;
AmmoFabricator.MaxUnits 5;
AmmoFabricator.MaxTypes 3;
AmmoFabricator.MaxUnitPrice 18000;
AmmoFabricator.ChanceFactor 2;
AmmoFabricator.TextColor Font.CR_GREEN;
@ -303,9 +272,9 @@ Class FabricatorTier3 : AmmoFabricator
Tag "$T_FABRICATOR3";
Inventory.PickupMessage "$T_FABRICATOR3";
AmmoFabricator.Budget 60000;
AmmoFabricator.PerType 2;
AmmoFabricator.MaxUnits 4;
AmmoFabricator.MaxTypes 3;
AmmoFabricator.PerType -25;
AmmoFabricator.MaxUnits 10;
AmmoFabricator.MaxTypes 4;
AmmoFabricator.MaxUnitPrice 50000;
AmmoFabricator.ChanceFactor 4;
AmmoFabricator.TextColor Font.CR_RED;

View file

@ -1,7 +1,6 @@
// player effects
// drop from monsters when using "Demoslayer" fun option
// heals up to 100 HP when touched
Class SlayerOrb : Actor abstract
{
Class<Actor> tclass;
@ -138,6 +137,34 @@ Class ArmorOrb : SlayerOrb
}
}
Class AmmoOrb : SlayerOrb
{
Default
{
SlayerOrb.TrailClass "AmmoOrbTrail";
}
override void PickedUp( int np, PlayerPawn mo )
{
int flg = CHANF_OVERLAP|CHANF_MAYBE_LOCAL;
if ( mo.CheckLocalView() ) flg |= CHANF_NOPAUSE;
mo.A_StartSound("misc/ammo_pkup",CHAN_ITEM,flg);
int tier = int(ceil(abs(scale.x*10)));
Class<Inventory> cls = "FabricatorTier1";
if ( tier >= 4 ) cls = "FabricatorTier3";
else if ( tier >= 2 ) cls = "FabricatorTier2";
let f = Inventory(Spawn(cls));
f.bQUIET = true;
if ( !f.CallTryPickup(mo) ) f.Destroy();
mo.player.bonuscount = Inventory.BONUSADD;
}
States
{
Spawn:
BLPF A -1 Bright;
Stop;
}
}
Class SlayerOrbTrail : Actor abstract
{
@ -186,6 +213,15 @@ Class ArmorOrbTrail : SlayerOrbTrail
Stop;
}
}
Class AmmoOrbTrail : SlayerOrbTrail
{
States
{
Spawn:
BLPS A -1 Bright;
Stop;
}
}
Class DashTrail : Actor
{