Easter Egg! ...s are now implemented

made gyrocopter voice faster to play, since it had a delay of like 0.40s
This commit is contained in:
yellows111 2024-03-12 00:13:27 +00:00
parent 6461f18a0f
commit 124725184a
9 changed files with 91 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

View File

@ -102,6 +102,18 @@ new GuiChunkedBitmapCtrl(playMissionGui) {
bitmap = "./play/text_window";
wrap = "0";
};
new GuiBitmapCtrl(PM_EggIcon) {
profile = "GuiDefaultProfile";
horizSizing = "width";
vertSizing = "height";
position = "275 40";
extent = "16 24";
minExtent = "8 8";
visible = "1";
helpTag = "0";
bitmap = "./play/egg_nf";
wrap = "0";
};
new GuiBitmapCtrl(PM_preview) {
profile = "GuiDefaultProfile";
horizSizing = "right";
@ -616,6 +628,7 @@ function PM_setSelected( %row )
%descText = %descText @ "<spush><font:DomCasualD:24><lmargin:0>\nTime to Qualify: " @ formatTime(%mission.time) @ "<spop>";
%file = %mission.file;
PM_EggIcon.setBitmap(($pref::easterEggCollected[%file] == 1) ? "marble/client/ui/play/egg" : "marble/client/ui/play/egg_nf");
getBestTimes(%file);
%descText = %descText @ "<lmargin:0>\n\n<spush><font:DomCasualD:24>Best Times:<spop><lmargin:10><tab:0,130,180><font:Arial Bold:14>\n\n";
for(%i = 0; %i < 3; %i++)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

View File

@ -0,0 +1,62 @@
//-----------------------------------------------------------------------------
// Kevin Blast Sources
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Easter Egg
//-----------------------------------------------------------------------------
datablock AudioProfile(GotEggSfx)
{
filename = "~/data/sound/gotEggVoice.wav";
description = AudioDefault3d;
preload = true;
};
datablock AudioProfile(GotThatEggAlready)
{
filename = "~/data/sound/gotpowerup.wav";
description = AudioDefault3d;
preload = true;
};
function EasterEgg::onPickup(%this,%obj,%user,%amount)
{
echo("onPickup");
Parent::onPickup(%this,%obj,%user,%amount);
%user.client.onFoundEasterEgg(%amount);
return true;
}
function EasterEgg::saveState(%this,%obj,%state)
{
%state.object[%obj.getId()] = %obj.isHidden();
}
function EasterEgg::restoreState(%this,%obj,%state)
{
%obj.hide(%state.object[%obj.getId()]);
}
//-----------------------------------------------------------------------------
datablock ItemData(EasterEgg)
{
// Mission editor category
category = "Misc";
// it's dumb but there isn't a GenericInventoryItem class;
// and we want onPickup to fire.
className = "PowerUp";
// Basic Item properties
shapeFile = "~/data/shapes/items/easteregg.dts";
mass = 1;
friction = 1;
elasticity = 0.3;
// Dynamic properties defined by the scripts
pickupName = "the Easter Egg!";
maxInventory = 1;
noRespawn = true;
noPickupMessage = true;
};

View File

@ -67,6 +67,9 @@ function onServerCreated()
exec("./signs.cs");
exec("./fireworks.cs");
//modded items
exec("./easterEgg.cs");
// Platforms and interior doors
exec("./pathedInteriors.cs");
@ -503,6 +506,19 @@ function GameConnection::onFoundGem(%this,%amount)
PlayGui.setGemCount(%this.gemCount);
}
function GameConnection::onFoundEasterEgg(%this, %amount)
{
if($pref::easterEggCollected[$Server::MissionFile] == 1) {
messageClient(%this, 'MsgItemPickup', '\c0You already have this Easter Egg.');
%this.play2d(GotThatEggAlready);
}
else
{
$pref::easterEggCollected[$Server::MissionFile] = 1;
messageClient(%this, 'MsgItemPickup', '\c0You got the Easter Egg!');
%this.play2d(GotEggSfx);
}
}
//-----------------------------------------------------------------------------