The stuff from master.
This commit is contained in:
parent
9e083a7b6a
commit
5d2aecafe1
11 changed files with 159 additions and 13 deletions
|
|
@ -186,7 +186,7 @@ extend Class SWWMHandler
|
|||
}
|
||||
int pnum = src.PlayerNumber();
|
||||
// achievement stuff
|
||||
if ( e.Thing.IsHostile(src) )
|
||||
if ( e.Thing.IsHostile(src) && (e.Thing.bISMONSTER || e.Thing.player) )
|
||||
{
|
||||
if ( (e.Thing.bBOSS||e.Thing.FindInventory("BossMarker")) && ((e.DamageType == 'Dash') || (e.DamageType == 'Buttslam')) )
|
||||
SWWMUtility.AchievementProgressInc("bossdash",1,src.player);
|
||||
|
|
@ -218,6 +218,18 @@ extend Class SWWMHandler
|
|||
onehpspree[pnum]++;
|
||||
SWWMUtility.AchievementProgress("onehp",onehpspree[pnum],src.player);
|
||||
}
|
||||
// tasty treats
|
||||
if ( swwm_demoslayer && (src.Health < 100) )
|
||||
{
|
||||
int amt = clamp(min(-e.Thing.Health,-e.Thing.GetGibHealth())/5,0,20);
|
||||
for ( int i=0; i<amt; i++ )
|
||||
{
|
||||
let a = Actor.Spawn("HealthOrb",e.Thing.Vec3Offset(0,0,e.Thing.Height/2));
|
||||
a.vel.z = FRandom[Junk](4,12);
|
||||
double ang = FRandom[Junk](0,360);
|
||||
a.vel.xy = (cos(ang),sin(ang))*FRandom[Junk](4,6);
|
||||
}
|
||||
}
|
||||
}
|
||||
// no credits unless it's a counted kill or marine (that isn't friendly) or another player in DM
|
||||
if ( e.Thing.IsFriend(src) || (!e.Thing.default.bCountKill && !(e.Thing is 'ScriptedMarine') && !(deathmatch && e.Thing.player)) )
|
||||
|
|
|
|||
|
|
@ -138,6 +138,7 @@ Class SWWMHealth : Inventory abstract
|
|||
newdamage = newdamage-GetDefaultByType(giveme).Amount;
|
||||
if ( newdamage < 0 ) Owner.GiveBody(-newdamage,GetDefaultByType(giveme).MaxAmount);
|
||||
newdamage = max(0,newdamage);
|
||||
if ( !morethanonce ) SWWMHandler.HealthFlash(Owner.PlayerNumber());
|
||||
AutoUseExtra(morethanonce);
|
||||
morethanonce = true;
|
||||
Amount--;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,127 @@
|
|||
// player effects
|
||||
|
||||
// drop from monsters when using "Demoslayer" fun option
|
||||
// heals up to 100 HP when touched
|
||||
Class HealthOrb : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
RenderStyle "Add";
|
||||
Radius 4;
|
||||
Height 8;
|
||||
Scale .5;
|
||||
BounceFactor .75;
|
||||
WallBounceFactor .75;
|
||||
Gravity .5;
|
||||
PROJECTILE;
|
||||
+THRUACTORS;
|
||||
-NOGRAVITY;
|
||||
+NOTELEPORT;
|
||||
+DONTSPLASH;
|
||||
+BOUNCEONWALLS;
|
||||
+BOUNCEONFLOORS;
|
||||
+BOUNCEONCEILINGS;
|
||||
+CANBOUNCEWATER;
|
||||
+FORCEXYBILLBOARD;
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
Vector3 oldp = pos;
|
||||
Super.Tick();
|
||||
if ( !isFrozen() )
|
||||
{
|
||||
let t = Spawn("HealthOrbTrail",pos);
|
||||
t.scale *= abs(scale.x);
|
||||
t.alpha *= alpha;
|
||||
scale *= .995;
|
||||
alpha = abs(scale.x)*2.;
|
||||
if ( abs(scale.x) < .1 )
|
||||
{
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
}
|
||||
int np = -1;
|
||||
double mdist = 600.;
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
{
|
||||
if ( !playeringame[i] || (players[i].Health < 0) || !players[i].mo || !CheckSight(players[i].mo,SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) ) continue;
|
||||
double dist = Distance3D(players[i].mo);
|
||||
if ( dist > mdist ) continue;
|
||||
mdist = dist;
|
||||
np = i;
|
||||
}
|
||||
if ( np == -1 ) return;
|
||||
let mo = players[np].mo;
|
||||
if ( SWWMUtility.BoxIntersect(self,mo,pad:8) )
|
||||
{
|
||||
int flg = CHANF_OVERLAP|CHANF_MAYBE_LOCAL;
|
||||
if ( mo.CheckLocalView() ) flg |= CHANF_NOPAUSE;
|
||||
mo.A_StartSound("misc/health_pkup",CHAN_ITEM,flg);
|
||||
int hp = int(ceil(abs(scale.x*10)));
|
||||
mo.GiveBody(hp,100);
|
||||
SWWMHandler.HealthFlash(np);
|
||||
SWWMScoreObj.Spawn(hp,mo.Vec3Offset(FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8),FRandom[ScoreBits](-8,8)+mo.Height/2),ST_Health);
|
||||
Destroy();
|
||||
return;
|
||||
}
|
||||
if ( isFrozen() ) return;
|
||||
Vector3 dirto = level.Vec3Diff(pos,mo.Vec3Offset(0,0,mo.Height/2));
|
||||
double distto = dirto.length();
|
||||
dirto /= distto;
|
||||
vel += dirto*((600.-distto)/400.)**2.;
|
||||
vel.z += .2;
|
||||
}
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
SpriteOffset = (0,-4);
|
||||
Scale.x *= RandomPick[Junk](-1,-1);
|
||||
Scale.y *= RandomPick[Junk](-1,-1);
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BLPF E -1 Bright;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
Class HealthOrbTrail : Actor
|
||||
{
|
||||
Default
|
||||
{
|
||||
RenderStyle "Add";
|
||||
Radius .1;
|
||||
Height 0.;
|
||||
Scale .25;
|
||||
Alpha .5;
|
||||
+FORCEXYBILLBOARD;
|
||||
+NOGRAVITY;
|
||||
+NOBLOCKMAP;
|
||||
+DONTSPLASH;
|
||||
+NOTELEPORT;
|
||||
+NOINTERACTION;
|
||||
}
|
||||
override void Tick()
|
||||
{
|
||||
if ( isFrozen() ) return;
|
||||
alpha *= .9;
|
||||
scale *= 1.05;
|
||||
if ( alpha < .05 ) Destroy();
|
||||
}
|
||||
override void PostBeginPlay()
|
||||
{
|
||||
Super.PostBeginPlay();
|
||||
SpriteOffset = (0,-4);
|
||||
}
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BLPS E -1 Bright;
|
||||
Stop;
|
||||
}
|
||||
}
|
||||
|
||||
Class DashTrail : Actor
|
||||
{
|
||||
Default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue