mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Add prints for winning / losing for now.
This commit is contained in:
parent
577f505342
commit
2ea84c2901
2 changed files with 25 additions and 5 deletions
|
|
@ -227,7 +227,13 @@ static void UFOMove(mobj_t *ufo)
|
||||||
path_t pathtofinish = {0};
|
path_t pathtofinish = {0};
|
||||||
size_t pathIndex = 0;
|
size_t pathIndex = 0;
|
||||||
|
|
||||||
|
boolean reachedEnd = false;
|
||||||
|
|
||||||
|
if (ufo_waypoint(ufo) >= 0)
|
||||||
|
{
|
||||||
curWaypoint = K_GetWaypointFromIndex((size_t)ufo_waypoint(ufo));
|
curWaypoint = K_GetWaypointFromIndex((size_t)ufo_waypoint(ufo));
|
||||||
|
}
|
||||||
|
|
||||||
destWaypoint = K_GetFinishLineWaypoint();
|
destWaypoint = K_GetFinishLineWaypoint();
|
||||||
|
|
||||||
if (curWaypoint == NULL || destWaypoint == NULL)
|
if (curWaypoint == NULL || destWaypoint == NULL)
|
||||||
|
|
@ -275,6 +281,7 @@ static void UFOMove(mobj_t *ufo)
|
||||||
if (curWaypoint == destWaypoint)
|
if (curWaypoint == destWaypoint)
|
||||||
{
|
{
|
||||||
// Reached the end.
|
// Reached the end.
|
||||||
|
reachedEnd = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -292,7 +299,7 @@ static void UFOMove(mobj_t *ufo)
|
||||||
if (pathfindsuccess == false)
|
if (pathfindsuccess == false)
|
||||||
{
|
{
|
||||||
// Path isn't valid.
|
// Path isn't valid.
|
||||||
// Just transition into the next state.
|
// Just keep going.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -302,6 +309,7 @@ static void UFOMove(mobj_t *ufo)
|
||||||
if (pathIndex >= pathtofinish.numnodes)
|
if (pathIndex >= pathtofinish.numnodes)
|
||||||
{
|
{
|
||||||
// Successfully reached the end of the path.
|
// Successfully reached the end of the path.
|
||||||
|
reachedEnd = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -313,6 +321,12 @@ static void UFOMove(mobj_t *ufo)
|
||||||
|
|
||||||
UFOMoveTo(ufo, newX, newY, newZ);
|
UFOMoveTo(ufo, newX, newY, newZ);
|
||||||
|
|
||||||
|
if (reachedEnd == true)
|
||||||
|
{
|
||||||
|
CONS_Printf("You lost...\n");
|
||||||
|
ufo_waypoint(ufo) = -1; // Invalidate
|
||||||
|
}
|
||||||
|
|
||||||
if (pathfindsuccess == true)
|
if (pathfindsuccess == true)
|
||||||
{
|
{
|
||||||
Z_Free(pathtofinish.array);
|
Z_Free(pathtofinish.array);
|
||||||
|
|
@ -366,16 +380,16 @@ static UINT8 GetUFODamage(mobj_t *inflictor)
|
||||||
return 30;
|
return 30;
|
||||||
}
|
}
|
||||||
case MT_ORBINAUT:
|
case MT_ORBINAUT:
|
||||||
case MT_ORBINAUT_SHIELD:
|
|
||||||
{
|
{
|
||||||
// Orbinauts deal double damage.
|
// Thrown orbinauts deal double damage.
|
||||||
return 20;
|
return 20;
|
||||||
}
|
}
|
||||||
case MT_JAWZ:
|
case MT_JAWZ:
|
||||||
case MT_JAWZ_SHIELD:
|
case MT_JAWZ_SHIELD:
|
||||||
|
case MT_ORBINAUT_SHIELD:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
// Jawz deal minimal damage.
|
// Jawz / shields deal regular damage.
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
player->emeralds |= special->extravalue1;
|
player->emeralds |= special->extravalue1;
|
||||||
K_CheckEmeralds(player);
|
K_CheckEmeralds(player);
|
||||||
break;
|
break;
|
||||||
|
case MT_SPECIAL_UFO:
|
||||||
|
if (!P_CanPickupItem(player, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
CONS_Printf("You win!\n");
|
||||||
|
break;
|
||||||
/*
|
/*
|
||||||
case MT_EERIEFOG:
|
case MT_EERIEFOG:
|
||||||
special->frame &= ~FF_TRANS80;
|
special->frame &= ~FF_TRANS80;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue