Skip to content

Commit

Permalink
Touchups to the hub. Initial sage dialogues.
Browse files Browse the repository at this point in the history
  • Loading branch information
OrdinaryMagician committed Feb 16, 2019
1 parent 1ce2e59 commit 3588cab
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 82 deletions.
30 changes: 10 additions & 20 deletions decorate.txt
Expand Up @@ -26,16 +26,16 @@ Actor mkHubGemStaticWater : mkHubGemStatic
Stop
}
}
Actor mkHubGemStaticWater : mkHubGemStatic
{
States
{
Spawn:
EGEM B -1
Stop
}
}

Actor mkHubGemStaticEarth : mkHubGemStatic
{
States
{
Spawn:
EGEM C -1
Stop
}
}

Actor mkHubGemStaticAir : mkHubGemStatic
{
Expand All @@ -47,16 +47,6 @@ Actor mkHubGemStaticAir : mkHubGemStatic
}
}

Actor mkHubGemStaticEarth : mkHubGemStatic
{
States
{
Spawn:
EGEM C -1
Stop
}
}

Actor mkHubGemStaticAether : mkHubGemStatic
{
States
Expand Down
2 changes: 2 additions & 0 deletions mapinfo.rachael
Expand Up @@ -8,6 +8,7 @@ episode HUB
cluster 1
{
hub
exittext = "..." // put something here -- MK
}

map HUB "Hub"
Expand All @@ -18,4 +19,5 @@ map HUB "Hub"
cluster = 1
levelnum = 1
music = "orchest"
next = EndGame2
}
Binary file modified maps/hub.wad
Binary file not shown.
16 changes: 15 additions & 1 deletion textures.marisa
@@ -1,5 +1,5 @@
// Texture definitions generated by SLADE3
// on Tue Jan 22 14:57:29 2019
// on Sat Feb 16 20:20:56 2019

Flat "F_SNOWIE", 64, 64
{
Expand Down Expand Up @@ -886,4 +886,18 @@ Sprite "FDMBZ0", 12, 9
Patch "FDMBA1", 0, 0
}

Texture "TPORTD", 64, 128
{
Patch "TPORT1", 0, 0
{
Translation "0:255=%[0.00,0.00,0.00]:[2.00,2.00,2.00]"
}
Patch "CAVE03", 0, 0
{
Translation "0:255=%[0.00,0.00,0.00]:[2.00,2.00,2.00]"
Alpha 0.40
Style Add
}
}

// End of texture definitions
91 changes: 30 additions & 61 deletions zscript/marisa/hub.zsc
Expand Up @@ -195,6 +195,7 @@ Class mkSageNPC : Actor
{
//$Title Sage NPC
//$Category Marisa/Decoration
//$Sprite SAGEB1
Speed 2;
Radius 16;
Height 64;
Expand Down Expand Up @@ -238,6 +239,7 @@ Class mkSageProjectionNPC : mkSageNPC
{
//$Title Sage NPC (Projection)
//$Category Marisa/Decoration
//$Sprite SAGEB1
RenderStyle "Translucent";
Alpha 0.0;
+NOGRAVITY;
Expand All @@ -248,10 +250,12 @@ Class mkSageProjectionNPC : mkSageNPC
{
Super.PostBeginPlay();
SetZ(floorz+8);
specialf1 = 2.5;
}
override void Tick()
{
Super.Tick();
if ( level.frozen || globalfreeze ) return;
// fade based on player distance
double mindist = double.infinity;
for ( int i=0; i<MAXPLAYERS; i++ )
Expand All @@ -261,13 +265,25 @@ Class mkSageProjectionNPC : mkSageNPC
if ( dist < mindist ) mindist = dist;
}
double talpha = clamp((500-mindist)*0.008,0.0,1.0);
if ( bDORMANT ) specialf1 = max(0.0,specialf1-0.08);
// alpha has some "pulse" to it
alpha = (0.75+sin(level.time*10)*0.1)*talpha;
alpha = (0.75+sin(level.time*10)*0.1)*talpha*min(1.0,specialf1);
if ( bDORMANT && (specialf1 <= 0) ) Destroy();
}
override void Deactivate( Actor activator )
{
bDORMANT = true;
bINCOMBAT = true;
bSOLID = false;
}
}

Class mkHubGem : Inventory abstract
{
String GemMsg;

Property GemMessage : GemMsg;

Default
{
+INVENTORY.UNDROPPABLE;
Expand Down Expand Up @@ -298,74 +314,22 @@ Class mkHubGem : Inventory abstract
}
}
Owner.A_PlaySound("misc/i_pkup",CHAN_ITEM,local:true);
Owner.A_Print(GemMsg);
if ( numpieces < totalpieces ) Owner.A_Print(String.Format("%d more %s%s left to find.",totalpieces-numpieces,GetDefaultByType((Class<Actor>)(GetParentClass())).GetTag(),((totalpieces-numpieces)>1)?"s":""));
else Owner.A_Print(String.Format("You have all the %ss.",GetDefaultByType((Class<Actor>)(GetParentClass())).GetTag()));
return false;
}
}

Class mkHubGemMundane : mkHubGem abstract
{
Default
{
Tag "Mundane Gem";
}

static bool HasAllGems()
{
int totalpieces = 0;
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
if ( AllActorClasses[i].GetParentClass() == 'mkHubGemMundane' ) totalpieces++;
}
int numpieces = 0;
for ( int j=0; j<MAXPLAYERS; j++ )
{
if ( !playeringame[j] || !players[j].mo ) continue;
for ( Inventory i=players[j].mo.inv; i; i=i.inv )
{
if ( i.GetParentClass() == 'mkHubGemMundane' ) numpieces++;
}
}
return (numpieces>=totalpieces);
}
}

Class mkHubGemArcane : mkHubGem abstract
{
Default
{
Tag "Arcane Gem";
}

static bool HasAllGems()
{
int totalpieces = 0;
for ( int i=0; i<AllActorClasses.Size(); i++ )
{
if ( AllActorClasses[i].GetParentClass() == 'mkHubGemArcane' ) totalpieces++;
}
int numpieces = 0;
for ( int j=0; j<MAXPLAYERS; j++ )
{
if ( !playeringame[j] || !players[j].mo ) continue;
for ( Inventory i=players[j].mo.inv; i; i=i.inv )
{
if ( i.GetParentClass() == 'mkHubGemArcane' ) numpieces++;
}
}
return (numpieces>=totalpieces);
}
}

Class mkHubGemFire : mkHubGemMundane
Class mkHubGemFire : mkHubGem
{
Default
{
//$Title Fire Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN0";
Tag "Fire Gem";
mkHubGem.GemMessage "It's warm to the touch.";
}
States
{
Expand All @@ -374,14 +338,15 @@ Class mkHubGemFire : mkHubGemMundane
Stop;
}
}
Class mkHubGemWater : mkHubGemMundane
Class mkHubGemWater : mkHubGem
{
Default
{
//$Title Water Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN1";
Tag "Water Gem";
mkHubGem.GemMessage "Although solid, your hands get wet when touching it.";
}
States
{
Expand All @@ -390,14 +355,15 @@ Class mkHubGemWater : mkHubGemMundane
Stop;
}
}
Class mkHubGemEarth : mkHubGemMundane
Class mkHubGemEarth : mkHubGem
{
Default
{
//$Title Earth Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN2";
Tag "Earth Gem";
mkHubGem.GemMessage "Feels rough to the touch.";
}
States
{
Expand All @@ -406,14 +372,15 @@ Class mkHubGemEarth : mkHubGemMundane
Stop;
}
}
Class mkHubGemAir : mkHubGemMundane
Class mkHubGemAir : mkHubGem
{
Default
{
//$Title Air Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN3";
Tag "Air Gem";
mkHubGem.GemMessage "Cool air seems to come out of it.";
}
States
{
Expand All @@ -422,14 +389,15 @@ Class mkHubGemAir : mkHubGemMundane
Stop;
}
}
Class mkHubGemAether : mkHubGemArcane
Class mkHubGemAether : mkHubGem
{
Default
{
//$Title Aether Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN4";
Tag "Aether Gem";
mkHubGem.GemMessage "You can feel some arcane power within.";
}
States
{
Expand All @@ -438,14 +406,15 @@ Class mkHubGemAether : mkHubGemArcane
Stop;
}
}
Class mkHubGemNether : mkHubGemArcane
Class mkHubGemNether : mkHubGem
{
Default
{
//$Title Nether Gem
//$Category Marisa/Key Items
Inventory.Icon "GEMICN5";
Tag "Nether Gem";
mkHubGem.GemMessage "There's something off about this gem...";
}
States
{
Expand Down

0 comments on commit 3588cab

Please sign in to comment.