void Inmater_Spawn(ServerEntity_t *eInmater) { Server_PrecacheModel(MODEL_INMATER_BODY); Entity_SetPhysics(eInmater, SOLID_SLIDEBOX, 3.0f, 4.5f); eInmater->Monster.type = MONSTER_INMATER; eInmater->Monster.Frame = Inmater_Think; eInmater->Monster.Pain = Inmater_Pain; Entity_SetKilledFunction(eInmater, Inmater_Die); eInmater->v.takedamage = true; eInmater->v.movetype = MOVETYPE_STEP; eInmater->v.health = INMATER_MAX_HEALTH; eInmater->v.netname = "Inmater"; eInmater->v.frame = 0; eInmater->local.maxhealth = INMATER_MAX_HEALTH; AI_SetState(eInmater, AI_STATE_AWAKE); AI_SetThink(eInmater, AI_THINK_IDLE); Entity_SetModel(eInmater, MODEL_INMATER_BODY); Entity_SetSize(eInmater, -16.0f, -16.0f, -24.0f, 16.0f, 16.0f, 32.0f); Entity_SetOrigin(eInmater, eInmater->v.origin); Entity_DropToFloor(eInmater); }
/* style 0 Mikiko 1 Superfly */ void Bot_Spawn(ServerEntity_t *eBot) { int iSpawnType; ServerEntity_t *eSpawnPoint; // Don't spawn bots unless it's allowed by admin. if(!cvServerBots.value) return; plClearVector3D(&eBot->v.velocity); switch(eBot->local.style) { case BOT_DEFAULT: iSpawnType = INFO_PLAYER_DEATHMATCH; eBot->v.model = cvServerPlayerModel.string; strncpy(eBot->v.netname, BotNames[(rand() % plArrayElements(BotNames))], 64); eBot->Monster.type = MONSTER_PLAYER; break; #ifdef GAME_OPENKATANA case BOT_COMPANION: iSpawnType = INFO_PLAYER_SUPERFLY; Server_PrecacheModel("models/sprfly.md2"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath1.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath2.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath3.wav"); // TODO: Placeholder! Server_PrecacheSound("player/superfly/superflydeath4.wav"); // TODO: Placeholder! eBot->v.model = "models/sprfly.md2"; // TODO: Placeholder! eBot->v.netname = "Companion Bot"; // TODO: give a proper name?? eBot->Monster.type = MONSTER_SUPERFLY; break; #endif default: Engine.Con_Warning("Attempted to spawn unknown bot type! (%i) (%i %i %i)\n", eBot->local.style, (int)eBot->v.origin.x, (int)eBot->v.origin.y, (int)eBot->v.origin.z); Entity_Remove(eBot); return; } eBot->v.classname = "bot"; eBot->v.health = 100; eBot->local.maxhealth = cvServerMaxHealth.iValue; eBot->v.movetype = MOVETYPE_STEP; eBot->v.takedamage = true; Entity_SetPhysics(eBot, SOLID_SLIDEBOX, 1.4f, 4.0f); eBot->local.bleed = true; eBot->Monster.Frame = Bot_Frame; eBot->Monster.Pain = Bot_Pain; // Default bots are purely for MP, so they spawn at player spawns. if(eBot->local.style == BOT_DEFAULT) { // Must be set after teams are set up. eSpawnPoint = Player_GetSpawnEntity(eBot, iSpawnType); if(!eSpawnPoint) { Engine.Con_Warning("%s failed to find spawnpoint!\n",eBot->v.netname); Entity_Remove(eBot); return; } Entity_SetOrigin(eBot,eSpawnPoint->v.origin); SetAngle(eBot,eSpawnPoint->v.angles); } Entity_SetKilledFunction(eBot, Bot_Die); eBot->Monster.Pain = Bot_Pain; eBot->Monster.Frame = Bot_Frame; Entity_SetModel(eBot,eBot->v.model); Entity_SetSize(eBot,-16.0f,-16.0f,-24.0f,16.0f,16.0f,32.0f); AI_SetState(eBot, AI_STATE_AWAKE); AI_SetThink(eBot, AI_THINK_IDLE); // Make sure we're not in the air. Entity_DropToFloor(eBot); }
/* style 0 Mikiko 1 Superfly */ void Bot_Spawn(edict_t *eBot) { int iSpawnType; edict_t *eSpawnPoint; // [20/1/2013] Don't spawn bots unless it's allowed by admin ~hogsy if(!cvServerBots.value) return; Math_VectorClear(eBot->v.velocity); // [29/7/2012] Names are now set here, the otherway was dumb ~hogsy switch(eBot->local.style) { case BOT_DEFAULT: iSpawnType = INFO_PLAYER_DEATHMATCH; eBot->v.model = cvServerPlayerModel.string; eBot->v.netname = BotNames[(rand()%pARRAYELEMENTS(BotNames))]; eBot->monster.iType = MONSTER_PLAYER; break; #ifdef OPENKATANA case BOT_MIKIKO: iSpawnType = INFO_PLAYER_MIKIKO; Engine.Server_PrecacheResource(RESOURCE_MODEL,"models/mikiko.md2"); eBot->v.model = "models/mikiko.md2"; eBot->v.netname = "Mikiko Ebihara"; eBot->monster.iType = MONSTER_MIKIKO; break; case BOT_SUPERFLY: iSpawnType = INFO_PLAYER_SUPERFLY; Engine.Server_PrecacheResource(RESOURCE_MODEL,"models/sprfly.md2"); Engine.Server_PrecacheResource(RESOURCE_SOUND,"player/superfly/superflydeath1.wav"); Engine.Server_PrecacheResource(RESOURCE_SOUND,"player/superfly/superflydeath2.wav"); Engine.Server_PrecacheResource(RESOURCE_SOUND,"player/superfly/superflydeath3.wav"); Engine.Server_PrecacheResource(RESOURCE_SOUND,"player/superfly/superflydeath4.wav"); eBot->v.model = "models/sprfly.md2"; eBot->v.netname = "Superfly Johnson"; eBot->monster.iType = MONSTER_SUPERFLY; break; #endif default: // [22/3/2013] Removed multiplayer support ~hogsy Engine.Con_Warning("Attempted to spawn unknown bot type! (%i) (%i %i %i)\n", eBot->local.style, (int)eBot->v.origin[0], (int)eBot->v.origin[1], (int)eBot->v.origin[2]); ENTITY_REMOVE(eBot); } eBot->v.cClassname = "bot"; eBot->v.iHealth = 100; eBot->v.iMaxHealth = (int)cvServerMaxHealth.value; eBot->v.movetype = MOVETYPE_STEP; eBot->v.bTakeDamage = true; eBot->Physics.iSolid = SOLID_SLIDEBOX; eBot->Physics.fGravity = SERVER_GRAVITY; eBot->Physics.fMass = 1.4f; eBot->Physics.fFriction = 4.0f; eBot->local.bBleed = true; eBot->monster.Think = Bot_Think; // Mikiko and Superfly are set manually to avoid issues... ~hogsy if(eBot->local.style == BOT_DEFAULT) { // [16/7/2012] Must be set after teams are set up ~hogsy eSpawnPoint = Entity_SpawnPoint(eBot,iSpawnType); if(!eSpawnPoint) { Engine.Con_Warning("%s failed to find spawnpoint!\n",eBot->v.netname); ENTITY_REMOVE(eBot); } Entity_SetOrigin(eBot,eSpawnPoint->v.origin); SetAngle(eBot,eSpawnPoint->v.angles); } // [15/7/2012] Set the initial state to awake ~hogsy eBot->monster.think_die = Bot_Die; eBot->monster.think_pain = Bot_Pain; eBot->monster.Think = Bot_Think; Entity_SetModel(eBot,eBot->v.model); Entity_SetSize(eBot,-16.0f,-16.0f,-24.0f,16.0f,16.0f,32.0f); Monster_SetState(eBot,STATE_AWAKE); Monster_SetThink(eBot,THINK_IDLE); // [6/8/2012] Make sure we're not in the air ~hogsy DropToFloor(eBot); }
void Point_PropSpawn(ServerEntity_t *eEntity) { if(!eEntity->v.model) Entity_Remove(eEntity); eEntity->v.iHealth = 10; if(eEntity->v.iHealth) { switch(eEntity->local.style) { case BREAKABLE_GLASS: Server_PrecacheSound(PHYSICS_SOUND_GLASS0); Server_PrecacheSound(PHYSICS_SOUND_GLASS1); Server_PrecacheSound(PHYSICS_SOUND_GLASS2); Server_PrecacheModel(PHYSICS_MODEL_GLASS0); Server_PrecacheModel(PHYSICS_MODEL_GLASS1); Server_PrecacheModel(PHYSICS_MODEL_GLASS2); break; case BREAKABLE_WOOD: Server_PrecacheSound(PHYSICS_SOUND_WOOD0); Server_PrecacheSound(PHYSICS_SOUND_WOOD1); Server_PrecacheSound(PHYSICS_SOUND_WOOD2); Server_PrecacheModel(PHYSICS_MODEL_WOOD0); Server_PrecacheModel(PHYSICS_MODEL_WOOD1); Server_PrecacheModel(PHYSICS_MODEL_WOOD2); break; case BREAKABLE_ROCK: Server_PrecacheSound(PHYSICS_SOUND_ROCK0); Server_PrecacheSound(PHYSICS_SOUND_ROCK1); Server_PrecacheSound(PHYSICS_SOUND_ROCK2); Server_PrecacheModel("models/gibs/rock_gibs1.md2"); Server_PrecacheModel("models/gibs/rock_gibs2.md2"); Server_PrecacheModel("models/gibs/rock_gibs3.md2"); break; case BREAKABLE_METAL: Server_PrecacheSound(PHYSICS_SOUND_METAL0); Server_PrecacheSound(PHYSICS_SOUND_METAL1); Server_PrecacheSound(PHYSICS_SOUND_METAL2); Server_PrecacheModel(PHYSICS_MODEL_METAL0); Server_PrecacheModel(PHYSICS_MODEL_METAL1); Server_PrecacheModel(PHYSICS_MODEL_METAL2); break; default: Engine.Con_Warning("Prop with unknown style! (%i)\n",eEntity->local.style); } eEntity->v.bTakeDamage = true; eEntity->local.bBleed = false; Entity_SetKilledFunction(eEntity, Area_BreakableDie); } Server_PrecacheModel(eEntity->v.model); eEntity->v.movetype = MOVETYPE_BOUNCE; eEntity->v.TouchFunction = Point_PropTouch; eEntity->Physics.iSolid = SOLID_BBOX; eEntity->Physics.fGravity = cvServerGravity.value; eEntity->Physics.fMass = 0.5f; Entity_SetModel(eEntity,eEntity->v.model); Entity_SetOrigin(eEntity,eEntity->v.origin); Entity_SetSize(eEntity,-16.0f,-16.0f,-24.0f,16.0f,16.0f,32.0f); }