mirror of
https://git.code.sf.net/p/quake/prozac-qfcc
synced 2024-11-27 14:32:03 +00:00
- make mass heal do a maximum of 200 hp per person
- nudge flares a bit, so they work better with QF
This commit is contained in:
parent
655fa7e52a
commit
9cae55b7d8
3 changed files with 62 additions and 5 deletions
|
@ -193,11 +193,20 @@ void() CrusaderMassHeal =
|
|||
{
|
||||
sound (te, CHAN_ITEM, "auras/aura3.wav", 1, ATTN_NORM);
|
||||
|
||||
if (te.health + 200 >= te.max_health) {
|
||||
te.health = te.max_health;
|
||||
if (self != te)
|
||||
sprint (te, PRINT_HIGH, self.netname, " restores you to full health\n");
|
||||
else
|
||||
sprint (te, PRINT_HIGH, "Your deity restores you to full health\n");
|
||||
} else {
|
||||
te.health += 200;
|
||||
if (self != te) {
|
||||
sprint (te, PRINT_HIGH, self.netname, " heals you, but you were too injured to be healed fully\n");
|
||||
sprint (self, PRINT_HIGH, te.netname, " was too injured to be healed fully\n");
|
||||
} else
|
||||
sprint (te, PRINT_HIGH, "Your diety heals you, but you were too injured to be healed fully\n");
|
||||
}
|
||||
}
|
||||
|
||||
te = te.chain;
|
||||
|
|
3
defs.qh
3
defs.qh
|
@ -1325,3 +1325,6 @@
|
|||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#define BOUND(a,b,c) (MAX((a), MIN((b), (c))))
|
||||
#define ASSERT(a) do {if (!(a)) error (__FILE__ + ":" + itos(__LINE__) + ": Assert failed: " + #a);} while (0)
|
||||
#define SIGN_i(a) (((a) < 0) ? -1 : +1)
|
||||
#define SIGN_f(a) (((a) < 0) ? -1.0 : +1.0)
|
||||
#define printf(...) do {dprint (sprintf (__VA_ARGS__));} while (0)
|
||||
|
|
45
often.qc
45
often.qc
|
@ -513,6 +513,27 @@ void (entity player) RemoveHolo =
|
|||
}
|
||||
};
|
||||
|
||||
vector (vector pos, vector dir) NudgeOnePosition =
|
||||
{
|
||||
local float a, b;
|
||||
a = pointcontents (pos + dir);
|
||||
b = pointcontents (pos - dir);
|
||||
if (a != CONTENTS_SOLID && b == CONTENTS_SOLID)
|
||||
return dir;
|
||||
else if (a == CONTENTS_SOLID && b != CONTENTS_SOLID)
|
||||
return -dir;
|
||||
else
|
||||
return '0 0 0';
|
||||
};
|
||||
|
||||
vector (vector pos) NudgePosition =
|
||||
{
|
||||
pos += NudgeOnePosition (pos, '1 0 0');
|
||||
pos += NudgeOnePosition (pos, '0 1 0');
|
||||
pos += NudgeOnePosition (pos, '0 0 1');
|
||||
return pos;
|
||||
};
|
||||
|
||||
//===========================//
|
||||
// THE FLARES ARE BACK! hehe //
|
||||
//===========================//
|
||||
|
@ -551,6 +572,30 @@ void() FlareGrenadeTouch =
|
|||
{
|
||||
sound (self, CHAN_MISC, "effects/bodyhit1.wav", 0.6, ATTN_NORM); // bounce sound
|
||||
}
|
||||
|
||||
// the networking imprecision causes them to be through the
|
||||
// wall on clients, and in QF this stops the light from
|
||||
// working properly. So I try to nudge them away from the
|
||||
// wall
|
||||
setorigin (self, NudgePosition (self.origin));
|
||||
/*
|
||||
local vector netpos;
|
||||
netpos_x = floor (self.origin_x * 8) / 8;
|
||||
netpos_y = floor (self.origin_y * 8) / 8;
|
||||
netpos_z = floor (self.origin_z * 8) / 8;
|
||||
local float contents = pointcontents (netpos);
|
||||
printf ("touch: %f\n", contents);
|
||||
if (contents == CONTENTS_SOLID) {
|
||||
local vector diff = self.origin - netpos;
|
||||
printf ("origin: %v netpos: %v diff: %v ",
|
||||
self.origin, netpos, diff);
|
||||
diff_x = diff_x ? SIGN_f (diff_x) * 0.25 : 0.0;
|
||||
diff_y = diff_y ? SIGN_f (diff_y) * 0.25 : 0.0;
|
||||
diff_z = diff_z ? SIGN_f (diff_z) * 0.25 : 0.0;
|
||||
printf ("nudge: %v\n", diff);
|
||||
setorigin (self, self.origin + diff);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue