Add secret difficulty for a dragon.

Remove 2x speed mult from hardest skill(s) (causes glitches).
Allow moths to still attack while following the lamp.
(Still do not know what causes moths to print "asin domain error" to terminal).
This commit is contained in:
Mari the Deer 2023-10-16 13:58:36 +02:00
commit f78b747ff7
7 changed files with 71 additions and 31 deletions

View file

@ -3,31 +3,30 @@
// tokens
Class DontDuplicate : Inventory {}
Class DontDuplicate2 : Inventory {}
Class GOTTAGOFAST : Inventory
{
override void DoEffect()
{
Super.DoEffect();
if ( !Owner || (Owner.Health <= 0) ) return;
if ( (Owner.tics > 1) && (Owner.tics > max(1,Owner.CurState.tics/2)) )
Owner.tics = max(1,Owner.CurState.tics/2);
}
}
extend Class SWWMHandler
{
double smult;
int dmult;
private void IWantDieSpawn( WorldEvent e )
{
if ( iwantdie == -1 ) iwantdie = (G_SkillName() == StringTable.Localize("$SWWM_SKLUNATIC"));
if ( iwantdie == -1 )
{
int acsre = G_SkillPropertyInt(SKILLP_ACSReturn);
iwantdie = (acsre >= 5);
smult = 2.-(acsre-5)*.5; // reduced in Kynikoss skill because it'd stack with FastMonsters
dmult = acsre-3;
}
if ( iwantdie <= 0 ) return;
if ( SWWMUtility.ValidProjectile(e.Thing) && !e.Thing.FindInventory("DontDuplicate") && (e.Thing.target && e.Thing.target.bISMONSTER && !e.Thing.target.player) )
{
e.Thing.speed *= 2;
e.Thing.vel *= 2;
e.Thing.speed *= smult;
e.Thing.vel *= smult;
double ang = e.Thing.target.target?e.Thing.AngleTo(e.Thing.target.target):e.Thing.angle;
double pt = e.Thing.target.target?e.Thing.PitchTo(e.Thing.target.target,e.Thing.target.missileheight,e.Thing.target.target.Height/2.):e.Thing.pitch;
let [x, y, z] = SWWMUtility.GetAxes(ang,pt,e.Thing.roll);
int numpt = Random[ExtraMissiles](1,2);
int numpt = Random[ExtraMissiles](1,dmult);
for ( int i=0; i<numpt; i++ )
{
double a = FRandom[ExtraMissiles](0,360);
@ -46,12 +45,11 @@ extend Class SWWMHandler
}
}
if ( !e.Thing.bISMONSTER || (e.Thing is 'PlayerPawn') ) return;
e.Thing.GiveInventory("GOTTAGOFAST",1);
// avoid if it has some sort of special handling
if ( e.Thing.special || e.Thing.tid || e.Thing.bDORMANT ) return;
// random chance to spawn doubles
if ( e.Thing.FindInventory("DontDuplicate") || Random[ExtraMissiles](0,2) ) return;
int numpt = Random[ExtraMissiles](1,2);
int numpt = Random[ExtraMissiles](1,dmult);
for ( int i=0; i<numpt; i++ )
{
// three attempts for each

View file

@ -232,7 +232,12 @@ Class LampMoth : Actor
Loop;
See.Entranced: // follow the lamp
XZW1 B 0 A_JumpIf(!isEntranced(),"Spawn");
XZW1 BC 1 A_FollowLamp();
XZW1 BC 1
{
A_FollowLamp();
// allow moths to still target enemies while following the lamp, but only if they get really close
A_LookEx(LOF_NOSOUNDCHECK|LOF_NOJUMP,maxseedist:150);
}
Loop;
Melee:
XZW1 B 0 A_Scrape();

View file

@ -782,6 +782,9 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
Font mFont;
int mColor;
int mColorSelected;
bool kyni;
double alph;
bool isSel;
void Init( ListMenuDescriptor desc, String text, String hotkey, Name child, int param = 0 )
{
@ -791,6 +794,9 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
mColor = desc.mFontColor;
mColorSelected = desc.mFontcolor2;
mHotkey = hotkey.GetNextCodePoint(0);
kyni = (text == "$SWWM_SKDRAGON");
if ( kyni ) alph = 0.;
else alph = 1.;
}
void InitDirect( double x, double y, int height, int hotkey, String text, Font font, int color, int color2, Name child, int param = 0 )
@ -801,6 +807,17 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
mColor = color;
mColorSelected = color2;
mHotkey = hotkey;
kyni = (text == "$SWWM_SKDRAGON");
if ( kyni ) alph = 0.;
else alph = 1.;
}
override void Ticker()
{
Super.Ticker();
if ( !kyni ) return;
if ( isSel ) alph = min(1.,alph+.05);
else alph = 0.;
}
override int GetWidth()
@ -813,6 +830,8 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
override void Draw( bool selected, ListMenuDescriptor desc )
{
isSel = selected;
if ( kyni && !isSel ) return;
int w = desc?desc.DisplayWidth():ListMenuDescriptor.CleanScale;
int h = desc?desc.DisplayHeight():-1;
String text = StringTable.Localize(mText);
@ -841,7 +860,7 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
int ch;
[ch, pos] = text.GetNextCodePoint(pos);
double yy = y+4*sin(32*i+8*(Menu.MenuTime()+System.GetTimeFrac()))*CleanYFac_1;
Screen.DrawChar(font,mColorSelected,xx,yy,ch,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl);
Screen.DrawChar(font,kyni?Font.CR_BLACK:mColorSelected,xx,yy,ch,DTA_ScaleX,CleanXFac_1*scl,DTA_ScaleY,CleanYFac_1*scl,DTA_Alpha,alph);
xx += (font.GetCharWidth(ch)+kern)*CleanXFac_1*scl;
}
}
@ -852,7 +871,7 @@ Class ListMenuItemSWWMTextItemM : ListMenuItemSelectable
int ch;
[ch, pos] = text.GetNextCodePoint(pos);
double yy = y+4*sin(32*i+8*(Menu.MenuTime()+System.GetTimeFrac()));
Screen.DrawChar(mFont,mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl);
Screen.DrawChar(mFont,kyni?Font.CR_BLACK:mColorSelected,xx,yy,ch,DTA_VirtualWidth,w,DTA_VirtualHeight,h,DTA_FullscreenScale,FSMode_ScaleToFit43,DTA_ScaleX,scl,DTA_ScaleY,scl,DTA_Alpha,alph);
xx += (font.GetCharWidth(ch)+kern)*scl;
}
}

View file

@ -312,7 +312,7 @@ extend Class Demolitionist
else if ( (player.cmd.buttons&BT_ATTACK) && (deadtimer > 120) && (!hnd || !hnd.gdat.disablerevive) && swwm_revive )
{
// reboot (if possible)
if ( !FindInventory("ReviveCooldown") && (((swwm_revivecooldown >= 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4)) || !hasrevived) )
if ( !FindInventory("ReviveCooldown") && (((swwm_revivecooldown >= 0) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 4)) || !hasrevived) && (G_SkillPropertyInt(SKILLP_ACSReturn) < 6) )
{
if ( hasrevived ) SWWMUtility.MarkAchievement("sekiro",player);
hasrevived = true;