Too lazy to comment

This commit is contained in:
2020-01-11 20:29:21 +01:00
parent 7bcb5f1e2a
commit 243165461b
121 changed files with 359938 additions and 177389 deletions

View File

@@ -332,6 +332,36 @@ void() FoundTarget =
HuntTarget ();
};
//escorting
// ------------------------------------------------
float() FindMonster =
// ------------------------------------------------
{
local entity beast;
if (self.attack_state != ESCORTING)
return FALSE;
if (self.enemy)
return FALSE;
beast = findradius(self.origin, 1500);
while(beast)
{
if ( (beast.flags & FL_MONSTER) && visible(beast) && beast != self && beast.health > 0)
self.enemy = beast;
beast = beast.chain;
}
if (!self.enemy)
return FALSE;
FoundTarget();
return TRUE;
};
//
/*
===========
FindTarget
@@ -354,6 +384,10 @@ float() FindTarget =
local entity client;
local float r;
// escorting
if (FindMonster())
return TRUE;
//
// if the first spawnflag bit is set, the monster will only wake up on
// really seeing the player, not another monster getting angry
@@ -398,7 +432,21 @@ float() FindTarget =
if ( /* client.show_hostile < time || */ !infront (client))
return FALSE;
}
// Set escort state for monster_demon
// https://www.quaddicted.com/webarchive/minion.planetquake.gamespy.com/tutorial/tutor8.htm
if (self.attack_state == ESCORTING)
return FALSE;
if (self.classname == "monster_demon1")
{
self.goalentity = client;
self.attack_state = ESCORTING;
self.th_walk();
return TRUE;
}
//
// got one
//
@@ -487,6 +535,14 @@ void(float dist) ai_walk =
return;
movetogoal (dist);
// escorting
if (self.attack_state == ESCORTING && vlen(self.origin - self.goalentity.origin) < 80)
{
self.pausetime = time + 3;
self.th_stand();
}
//
};

View File

@@ -1143,8 +1143,6 @@ void() PlayerPostThink =
self.jump_flag = self.velocity_z;
CheckPowerups ();
if (time < 5)
centerprint(self, "This is my first Quake mod!\n");
};

View File

@@ -690,4 +690,4 @@ float (entity e, float healamount, float ignore) T_Heal; // health function
float(entity targ, entity inflictor) CanDamage;
float ESCORTING = 5;