mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Direct players to battle UFOs via Obj_PointPlayersToXY
This commit is contained in:
parent
a98db957e6
commit
1c633dd9ee
5 changed files with 25 additions and 2 deletions
|
|
@ -71,7 +71,8 @@ typedef enum
|
||||||
PF_GAINAX = 1<<3,
|
PF_GAINAX = 1<<3,
|
||||||
|
|
||||||
PF_KICKSTARTACCEL = 1<<4, // Accessibility feature: Is accelerate in kickstart mode?
|
PF_KICKSTARTACCEL = 1<<4, // Accessibility feature: Is accelerate in kickstart mode?
|
||||||
// 1<<5 free
|
|
||||||
|
PF_POINTME = 1<<5, // An object is calling for my attention (via Obj_PointPlayersToMobj). Unset every frame!
|
||||||
// 1<<6 free
|
// 1<<6 free
|
||||||
|
|
||||||
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
|
PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join
|
||||||
|
|
|
||||||
|
|
@ -8353,6 +8353,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
K_HandleDelayedHitByEm(player);
|
K_HandleDelayedHitByEm(player);
|
||||||
|
|
||||||
|
player->pflags &= ~PF_POINTME;
|
||||||
}
|
}
|
||||||
|
|
||||||
void K_KartResetPlayerColor(player_t *player)
|
void K_KartResetPlayerColor(player_t *player)
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ void Obj_SpawnGachaBomRebound(mobj_t *source, mobj_t *target);
|
||||||
|
|
||||||
/* Servant Hand */
|
/* Servant Hand */
|
||||||
void Obj_ServantHandHandling(player_t *player);
|
void Obj_ServantHandHandling(player_t *player);
|
||||||
|
void Obj_PointPlayersToXY(fixed_t x, fixed_t y);
|
||||||
|
|
||||||
/* Super Flicky Controller */
|
/* Super Flicky Controller */
|
||||||
void Obj_SpawnSuperFlickySwarm(player_t *owner, tic_t time);
|
void Obj_SpawnSuperFlickySwarm(player_t *owner, tic_t time);
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,8 @@ void Obj_BattleUFOThink(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
ufo->spawn_beam();
|
ufo->spawn_beam();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Obj_PointPlayersToXY(mobj->x, mobj->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Obj_BattleUFODeath(mobj_t *mobj)
|
void Obj_BattleUFODeath(mobj_t *mobj)
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,12 @@
|
||||||
#include "../k_kart.h"
|
#include "../k_kart.h"
|
||||||
#include "../k_objects.h"
|
#include "../k_objects.h"
|
||||||
#include "../v_video.h"
|
#include "../v_video.h"
|
||||||
|
#include "../r_main.h"
|
||||||
|
#include "../g_game.h"
|
||||||
|
|
||||||
void Obj_ServantHandHandling(player_t *player)
|
void Obj_ServantHandHandling(player_t *player)
|
||||||
{
|
{
|
||||||
if (player->pflags & PF_WRONGWAY)
|
if (player->pflags & PF_WRONGWAY || player->pflags & PF_POINTME)
|
||||||
{
|
{
|
||||||
if (player->handtimer < TICRATE)
|
if (player->handtimer < TICRATE)
|
||||||
{
|
{
|
||||||
|
|
@ -101,3 +103,18 @@ void Obj_ServantHandHandling(player_t *player)
|
||||||
player->hand->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
|
player->hand->renderflags |= (RF_DONTDRAW & ~K_GetPlayerDontDrawFlag(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Obj_PointPlayersToXY(fixed_t x, fixed_t y)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i] || players[i].spectator || !players[i].mo)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
angle_t angletotarget = R_PointToAngle2(
|
||||||
|
players[i].mo->x, players[i].mo->y,
|
||||||
|
x, y);
|
||||||
|
players[i].pflags |= PF_POINTME;
|
||||||
|
players[i].besthanddirection = angletotarget;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue