djcev.com

//

Git Repos / fte_dogmode / qc / items / runes.qc

Last update to this file was on 2024-06-15 at 19:50.

Show runes.qc

//==============================================================================
// END OF LEVEL RUNES
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
void() item_sigil_touch2;
void() item_sigil_touch;
entity(entity src, vector org, vector vel, float flags) spawn_item_sigil;
void(entity e) item_sigil_init;
void() item_sigil;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
/*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4 X SPAWN_SILENT TRIGGER_SPAWNED SUSPENDED_IN_AIR NOT_ON_EASY NOT_ON_NORMAL NOT_ON_HARD_OR_NIGHTMARE NOT_IN_DEATHMATCH NOT_IN_COOP NOT_IN_SINGLEPLAYER X NOT_ON_HARD_ONLY NOT_ON_NIGHTMARE_ONLY
{
model ( {{ spawnflags & 1 -> { "path" : "progs/end1.mdl" }, spawnflags & 2 -> { "path" : "progs/end2.mdl" },
spawnflags & 4 -> { "path" : "progs/end3.mdl" }, spawnflags & 8 -> { "path" : "progs/end4.mdl" },
"progs/end1.mdl" }} );
}
End of episode rune. Use in conjuction with func_bossgate and func_episodegate.
Spawnflag must be set to the appropriate episode.
Episode 1 - Dimension of the Doomed - Rune of Earth Magic
Episode 2 - The Realm of Black Magic - Rune of Black Magic
Episode 3 - The Netherworld - Rune of Hell Magic
Episode 4 - The Elder World - Run of Elder Magic
*/
//----------------------------------------------------------------------
// class item_sigil: base_item
// {
//--------------------------------------------------------------
// sigil_touch2 -- replacement for Skill Select Rune hack
// uses info_player_start2 if spawnflag 16 -- dumptruck_ds
//--------------------------------------------------------------
void() item_sigil_touch2 =
{
if (other.classtype != CT_PLAYER)
return;
if (other.health <= 0)
return;

// centerprint (other, "You got the rune!");

// sound (other, CHAN_ITEM, this.noise, VOL_HIGH, ATTN_NORM);
// stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = __NULL__;
serverflags = serverflags | (self.spawnflags & 16);
// so rune doors won't find it
self.classname = "";

activator = other;
// fire all targets / killtargets
// sub_usetargets ();
};

//--------------------------------------------------------------
void() item_sigil_touch =
{
if (sub_checkvalidtouch(other) == FALSE)
return;

centerprint (other, "You got the rune!");

sound (other, CHAN_ITEM, self.noise, VOL_HIGH, ATTN_NORM);
stuffcmd (other, "bf\n");
self.solid = SOLID_NOT;
self.model = __NULL__;
serverflags = serverflags | (self.spawnflags & 15);
// so rune doors won't find it
self.classname = "";

activator = other;
// fire all targets / killtargets
sub_usetargets ();
};

//--------------------------------------------------------------
entity(entity src, vector org, vector vel, float flags)
spawn_item_sigil =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
e.velocity = vel;
e.spawnflags = flags;
item_sigil_init (e);
return e;
};

//--------------------------------------------------------------
void(entity e) item_sigil_init =
{
e.classname = "item_sigil";
e.classtype = CT_ITEM_RUNE;
e.touch = item_sigil_touch;

if (!e.spawnflags)
objerror ("no spawnflags");

precache_sound ("misc/runekey.wav");
e.noise = "misc/runekey.wav";

if (e.spawnflags & 1)
{
precache_model ("progs/end1.mdl");
setmodel (e, "progs/end1.mdl");
}

if (e.spawnflags & 2)
{
precache_model2 ("progs/end2.mdl");
setmodel (e, "progs/end2.mdl");
}

if (e.spawnflags & 4)
{
precache_model2 ("progs/end3.mdl");
setmodel (e, "progs/end3.mdl");
}

if (e.spawnflags & 8)
{
precache_model2 ("progs/end4.mdl");
setmodel (e, "progs/end4.mdl");
}

e.pos1 = '-16 -16 -24';
e.pos2 = '16 16 32';

e.particles_offset = '0 0 18';

// StartItem
base_item_init (e);
};

//--------------------------------------------------------------
void() item_sigil =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

item_sigil_init (self);
};
// };
#endif

Return to the top of this page or return to the overview of this repo.

Log runes.qc

Return to the top of this page or return to the overview of this repo.