Skip to content

Commit 401531d

Browse files
committed
Further progress
1 parent 789eb1c commit 401531d

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

src/SB/Core/x/xNPCBasic.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ enum en_npcdcat
2222
eNPCDCAT_Zero,
2323
eNPCDCAT_Seven = 7,
2424
eNPCDCAT_Eight = 8,
25+
eNPCDCAT_Ten = 10,
2526
eNPCDCAT_Eleven = 11,
2627
eNPCDCAT_Thirteen = 13,
2728
};

src/SB/Game/zNPCGoalRobo.cpp

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,42 @@ S32 zNPCGoalAlertMonsoon::Resume(F32 dt, void* updCtxt)
16051605
return zNPCGoalCommon::Resume(dt, updCtxt);
16061606
}
16071607

1608+
void zNPCGoalAlertMonsoon::MoveCorner(F32 dt)
1609+
{
1610+
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
1611+
F32 ds2_corn;
1612+
xVec3 dir_corn;
1613+
if (*(U8*)(&npc->npcset.allowChase) && npc->arena.IsReady() && (npc->arena.Radius(1.0f) > 2.0f))
1614+
{
1615+
ds2_corn = npc->XYZDstSqToPos(&pos_corner, 0);
1616+
if (ds2_corn < SQ(0.5f))
1617+
{
1618+
npc->CornerOfArena(&pos_corner, -1.0f);
1619+
ds2_corn = npc->XYZDstSqToPos(&pos_corner, NULL);
1620+
}
1621+
if (npc->DBG_IsNormLog(eNPCDCAT_Ten, 2))
1622+
{
1623+
xDrawSetColor(g_BLUE);
1624+
xDrawSphere2(&pos_corner, 0.1f, 12);
1625+
}
1626+
if ((tmr_reload >= 0.0f) && (tmr_reload < 1.0f))
1627+
{
1628+
npc->ThrottleAdjust(dt, 1.5, -1.0);
1629+
}
1630+
else if (ds2_corn < 2.0f)
1631+
{
1632+
npc->ThrottleAdjust(dt, 1.5f, -1.0f);
1633+
}
1634+
else
1635+
{
1636+
npc->ThrottleAdjust(dt, 3.5f, -1.0f);
1637+
}
1638+
npc->XYZVecToPos(&dir_corn, &pos_corner);
1639+
xVec3Normalize(&dir_corn, &dir_corn);
1640+
npc->ThrottleApply(dt, &dir_corn, 0);
1641+
}
1642+
}
1643+
16081644
S32 zNPCGoalAlertSleepy::Enter(F32 dt, void* updCtxt)
16091645
{
16101646
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
@@ -2083,6 +2119,42 @@ void zNPCGoalAlertSlick::GetInArena(F32 dt)
20832119
npc->ThrottleApply(dt, &dir, 0);
20842120
}
20852121

2122+
void zNPCGoalAlertSlick::MoveCorner(F32 dt)
2123+
{
2124+
zNPCRobot* npc = (zNPCRobot*)(psyche->clt_owner);
2125+
F32 ds2_corn;
2126+
xVec3 dir_corn;
2127+
if (*(U8*)(&npc->npcset.allowChase) && npc->arena.IsReady() && (npc->arena.Radius(1.0f) > 2.0f))
2128+
{
2129+
ds2_corn = npc->XYZDstSqToPos(&pos_corner, 0);
2130+
if (ds2_corn < SQ(0.5f))
2131+
{
2132+
npc->CornerOfArena(&pos_corner, -1.0f);
2133+
ds2_corn = npc->XYZDstSqToPos(&pos_corner, NULL);
2134+
}
2135+
if (npc->DBG_IsNormLog(eNPCDCAT_Ten, 2))
2136+
{
2137+
xDrawSetColor(g_BLUE);
2138+
xDrawSphere2(&pos_corner, 0.1f, 12);
2139+
}
2140+
if ((tmr_reload >= 0.0f) && (tmr_reload < 1.0f))
2141+
{
2142+
npc->ThrottleAdjust(dt, 1.5, -1.0);
2143+
}
2144+
else if (ds2_corn < 2.0f)
2145+
{
2146+
npc->ThrottleAdjust(dt, 1.5f, -1.0f);
2147+
}
2148+
else
2149+
{
2150+
npc->ThrottleAdjust(dt, 3.5f, -1.0f);
2151+
}
2152+
npc->XYZVecToPos(&dir_corn, &pos_corner);
2153+
xVec3Normalize(&dir_corn, &dir_corn);
2154+
npc->ThrottleApply(dt, &dir_corn, 0);
2155+
}
2156+
}
2157+
20862158
S32 zNPCGoalAttackCQC::Enter(F32 dt, void* updCtxt)
20872159
{
20882160
zNPCCommon* npc = (zNPCCommon*)this->psyche->clt_owner;

0 commit comments

Comments
 (0)