djcev.com

//

Git Repos / fte_dogmode / qc / compat / mg1.qc

Last update to this file was on 2025-08-13 at 05:20.

Show mg1.qc

//==============================================================================
// KNOWN_RELEASE_MG1 compatibility - Machine Games "Dimension Of The Machine"
//==============================================================================

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

#ifdef SSQC
void() compat_mg1_monster_spawnflags;
#endif

#ifdef SSQC
// info_player_start_hub
void(entity e) info_player_start_hub_init;
void() info_player_start_hub;
#endif

#ifdef SSQC
// trigger_activate_coop_spawns
void() trigger_activate_coop_spawns;
#endif

#ifdef SSQC
// func_explode
void() func_explode;
#endif

#ifdef SSQC
// misc_corpse
void() misc_corpse;
#endif

#ifdef SSQC
// hub_trigger_changelevel
void() hub_trigger_changelevel;
#endif

#ifdef SSQC
// trigger_cleanup_corpses
void() trigger_cleanup_corpses;
#endif

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

#ifdef SSQC
//----------------------------------------------------------------------
void() compat_mg1_monster_spawnflags =
{
local float startflags = self.spawnflags;

// spawnflag 4 is SPAWNED in MG1; entity waits to be used -- CEV
if (startflags & 4)
{
self.spawnflags &= ~4;
self.spawnflags |= SPAWNFLAG_MONSTER_SPAWNED;
}

// spawnflag 8 is ANGRY in MG1 -- CEV
if (startflags & 8)
{
self.spawnflags &= ~8;
self.spawnflags |= SPAWNFLAG_MONSTER_ANGRY;
}

// spawnflag 16 is TFOG in MG1 -- CEV
if (startflags & 16)
{
self.spawnflags &= ~16;
self.wait = 0;
}
else
{
self.wait = 1;
}

// spawnflag 32 is ATTACK_FRIEND in MG1 -- CEV
if (startflags & 32)
{
self.spawnflags &= ~32;
// TODO CEV
}

// whatever spawnflag 64 in MG1 is it's incompatible -- CEV
if (startflags & 64)
{
self.spawnflags &= ~64;
// TODO CEV
}

// spawnflag 4096 is WAITWALK in MG1 -- CEV
if (startflags & 4096)
{
self.spawnflags &= ~4096;
self.spawnflags |= SPAWNFLAG_MONSTER_WAITWALK;
}
};
#endif

#ifdef SSQC
/*QUAKED info_player_start_hub (1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode.
*/
//----------------------------------------------------------------------
// class info_player_start_hub: base_mapentity
// {
//--------------------------------------------------------------
void(entity e) info_player_start_hub_init =
{
base_mapentity_init (e);
e.classname = "info_player_start_hub";
e.classtype = CT_INFO_PLAYER_START_HUB;
};

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

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

#ifdef SSQC
//----------------------------------------------------------------------
// class trigger_activate_coop_spawns: entity
// {
//--------------------------------------------------------------
void() trigger_activate_coop_spawns =
{
remove (self);
};
// };
#endif

#ifdef SSQC
/*QUAKED func_explode (0 .5 .8) (0 0 0) (32 32 64)
Custom exploding box
*/
//----------------------------------------------------------------------
// class func_explode: base_func
// {
//--------------------------------------------------------------
void() func_explode =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

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

#ifdef SSQC
//----------------------------------------------------------------------
// class misc_corpse: base_misc_model
// {
//--------------------------------------------------------------
void() misc_corpse =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

if (self.style < 0 || self.style >= 38)
{
objerror ("misc_corpse with invalid style");
return;
}

self.style += ITEM_SEQ_THROWABLE_START;

switch (self.style)
{
case ITEM_SEQ_CORPSE_DEMON_1:
monster_dead_demon_init (self);
break;
case ITEM_SEQ_CORPSE_DOG_1:
self.spawnflags |= 2;
monster_dead_dog_init (self);
break;
case ITEM_SEQ_CORPSE_DOG_2:
self.spawnflags |= 4;
monster_dead_dog_init (self);
break;
case ITEM_SEQ_CORPSE_ENFORCER_1:
monster_dead_enforcer_init (self);
break;
case ITEM_SEQ_CORPSE_ENFORCER_2:
self.spawnflags |= 2;
monster_dead_enforcer_init (self);
break;
case ITEM_SEQ_CORPSE_FISH_1:
monster_dead_fish_init (self);
break;
case ITEM_SEQ_CORPSE_HKNIGHT_1:
monster_dead_hell_knight_init (self);
break;
case ITEM_SEQ_CORPSE_HKNIGHT_2:
self.spawnflags |= 2;
monster_dead_hell_knight_init (self);
break;
case ITEM_SEQ_CORPSE_KNIGHT_1:
self.spawnflags |= 2;
monster_dead_knight_init (self);
break;
case ITEM_SEQ_CORPSE_KNIGHT_2:
monster_dead_knight_init (self);
break;
case ITEM_SEQ_CORPSE_OGRE_1:
self.spawnflags |= 2;
monster_dead_ogre_init (self);
break;
case ITEM_SEQ_CORPSE_OGRE_2:
monster_dead_ogre_init (self);
break;
case ITEM_SEQ_CORPSE_SHALRATH_1:
monster_dead_shalrath_init (self);
break;
case ITEM_SEQ_CORPSE_SHAMBLER_1:
monster_dead_shambler_init (self);
break;
case ITEM_SEQ_CORPSE_SOLDIER_1:
self.spawnflags |= 2;
monster_dead_army_init (self);
break;
case ITEM_SEQ_CORPSE_SOLDIER_2:
monster_dead_army_init (self);
break;
case ITEM_SEQ_CORPSE_WIZARD_1:
monster_dead_wizard_init (self);
break;
case ITEM_SEQ_CORPSE_PLAYER_1:
player_dead_axe ();
break;
case ITEM_SEQ_CORPSE_PLAYER_2:
// TODO CEV
// misc_corpse_init (self);
break;
case ITEM_SEQ_CORPSE_PLAYER_3:
// TODO CEV
// misc_corpse_init (self);
break;
case ITEM_SEQ_CORPSE_PLAYER_4:
// TODO CEV
// misc_corpse_init (self);
break;
case ITEM_SEQ_CORPSE_PLAYER_5:
// TODO CEV
// misc_corpse_init (self);
break;
case ITEM_SEQ_CORPSE_PLAYER_6:
player_dead_on_side ();
break;
case ITEM_SEQ_HEAD_DEMON..ITEM_SEQ_GIB3:
self.weapon = self.style;
self.style = 0;
base_item_throwable_init (self);
break;
default:
objerror ("misc_corpse with invalid style");
}
};
// };
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// class hub_trigger_changelevel: trigger_changelevel
// {
//--------------------------------------------------------------
void() hub_trigger_changelevel =
{
if ((serverflags & SIGIL_ALL) !=SIGIL_ALL)
{
remove (self);
return;
}

trigger_changelevel ();
};
// }
#endif

#ifdef SSQC
//----------------------------------------------------------------------
// class trigger_cleanup_corpses: entity
// {
//--------------------------------------------------------------
// TODO CEV might not be a bad idea to implement this for real
//--------------------------------------------------------------
void() trigger_cleanup_corpses =
{
remove (self);
};
// };
#endif

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

Log mg1.qc

Date Commit Message Author + -
2025-08-13 Another big commit. Item changes, field rework, etc. cev +77 -118
2025-03-30 Big commit. Entity networking, etc. cev +342  

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