Fix gamerules against latest Nuclide, lay out some more typeInfo

This commit is contained in:
Marco Cawthorne 2024-11-05 20:33:11 -08:00
parent 01923a51af
commit cc74146a59
11 changed files with 69 additions and 48 deletions

View file

@ -14,6 +14,7 @@
#define DISTRIBUTIONLONG "eukara"
#define GAME_FULLNAME FULLENGINENAME
#define GAME_DEFAULTPORT 23000
#define GAME_DEFAULTCMDS "game_valve;fteplug_ffmpeg;plug_load ffmpeg;exec quake.rc"
#define ENGINEWEBSITE "https://www.frag-net.com/"
#ifndef GLQUAKE

View file

@ -64,29 +64,29 @@ CodeCallback_StartGameType(void)
}
void
CodeCallback_PlayerSpawn(void)
CodeCallback_PlayerSpawn(entity playerEntity)
{
string playerModel;
ents.ChangeToClass(self, "player_mp");
ents.ChangeToClass(playerEntity, "player_mp");
if (IsTeamplay() == true) {
float teamCount = tokenizebyseparator(g_strTeamList, ";");
float playerTeam = self.team;
float playerTeam = playerEntity.team;
string teamModel;
/* not part of a team? pick one of the ones we have */
/* TODO: this should sort us into the lowest team */
if (playerTeam == 0) {
playerTeam = 1 + floor(random(0, teamCount)); /* teams start at 1 after all */
ents.Input(self, "SetTeam", ftos(playerTeam), self);
ents.Input(playerEntity, "SetTeam", ftos(playerTeam), playerEntity);
}
teamModel = argv(playerTeam - 1);
playerModel = sprintf("models/player/%s/%s.mdl", teamModel, teamModel);
} else {
/* interpret the 'model' InfoKey */
playerModel = userinfo.GetString(self, "model");
playerModel = userinfo.GetString(playerEntity, "model");
if (playerModel != "") {
playerModel = sprintf("models/player/%s/%s.mdl", playerModel, playerModel);
@ -98,36 +98,31 @@ CodeCallback_PlayerSpawn(void)
playerModel = "models/player.mdl";
}
self.modelindex = getmodelindex(playerModel); /* keep OG size */
game.TeleportToSpawn(self);
decl damageDecl = declManager.New();
declManager.AddKey(damageDecl, "damage", "50");
declManager.Delete(damageDecl);
combat.Damage(self, self, self, damageDecl, self.origin, g_vec_null, self.origin);
playerEntity.modelindex = getmodelindex(playerModel); /* keep OG size */
game.TeleportToSpawn(playerEntity);
}
void
CodeCallback_PlayerDisconnect(void)
CodeCallback_PlayerDisconnect(entity playerEntity)
{
}
bool
CodeCallback_PlayerRequestRespawn(void)
CodeCallback_PlayerRequestRespawn(entity playerEntity)
{
CodeCallback_PlayerSpawn();
CodeCallback_PlayerSpawn(playerEntity);
return (true);
}
void
CodeCallback_PlayerDamage(entity inflictor, entity attacker)
CodeCallback_PlayerDamage(entity playerEntity, entity inflictor, entity attacker)
{
}
void
CodeCallback_PlayerKilled(entity inflictor, entity attacker, string weapon)
CodeCallback_PlayerKilled(entity playerEntity, entity inflictor, entity attacker, string weapon)
{
combat.Obituary(self.netname, attacker.netname, weapon, "");
@ -145,7 +140,7 @@ CodeCallback_PlayerKilled(entity inflictor, entity attacker, string weapon)
}
bool
CodeCallback_ClientCommand(string command)
CodeCallback_ClientCommand(entity playerEntity, string command)
{
float commandArgs = tokenize(command);
@ -182,7 +177,7 @@ CodeCallback_ClientCommand(string command)
}
bool
CodeCallback_ImpulseCommand(float impulseNum)
CodeCallback_ImpulseCommand(entity playerEntity, float impulseNum)
{
switch (impulseNum) {
case 100:

View file

@ -48,7 +48,6 @@ CodeCallback_StartGameType(void)
ents.Precache(autocvar_invasion_monsterClass);
motd.LoadDefault();
game.SetSpawnPoint("info_player_deathmatch");
cvars.SetBool("coop", true);
teams.SetUp(1, "Military", [0, 255, 0], false);
teams.SetUp(2, "Aliens", [255, 0, 0], false);
@ -63,15 +62,15 @@ CodeCallback_StartGameType(void)
}
void
CodeCallback_PlayerSpawn(void)
CodeCallback_PlayerSpawn(entity playerEntity)
{
string playerModel;
ents.ChangeToClass(self, "player_mp");
ents.Input(self, "SetTeam", "3", world);
ents.ChangeToClass(playerEntity, "player_mp");
ents.Input(playerEntity, "SetTeam", "3", world);
/* interpret the 'model' InfoKey */
playerModel = userinfo.GetString(self, "model");
playerModel = userinfo.GetString(playerEntity, "model");
if (playerModel != "") {
playerModel = sprintf("models/player/%s/%s.mdl", playerModel, playerModel);
@ -82,40 +81,40 @@ CodeCallback_PlayerSpawn(void)
playerModel = "models/player.mdl";
}
self.modelindex = getmodelindex(playerModel); /* keep OG size */
game.TeleportToSpawn(self);
playerEntity.modelindex = getmodelindex(playerModel); /* keep OG size */
game.TeleportToSpawn(playerEntity);
}
void
CodeCallback_PlayerDisconnect(void)
CodeCallback_PlayerDisconnect(entity playerEntity)
{
}
bool
CodeCallback_PlayerRequestRespawn(void)
CodeCallback_PlayerRequestRespawn(entity playerEntity)
{
CodeCallback_PlayerSpawn();
CodeCallback_PlayerSpawn(playerEntity);
return (true);
}
void
CodeCallback_PlayerDamage(entity inflictor, entity attacker)
CodeCallback_PlayerDamage(entity playerEntity, entity inflictor, entity attacker)
{
}
void
CodeCallback_PlayerKilled(entity inflictor, entity attacker, string weapon)
CodeCallback_PlayerKilled(entity playerEntity, entity inflictor, entity attacker, string weapon)
{
combat.Obituary(self.netname, attacker.netname, weapon, "");
combat.Obituary(playerEntity.netname, attacker.netname, weapon, "");
/* death-counter */
self.deaths++;
playerEntity.deaths++;
/* update score-counter */
if (ents.isPlayer(attacker)) {
if (self == attacker) {
if (playerEntity == attacker) {
attacker.frags--;
} else {
attacker.frags++;
@ -126,13 +125,13 @@ CodeCallback_PlayerKilled(entity inflictor, entity attacker, string weapon)
}
void
CodeCallback_NPCKilled(entity inflictor, entity attacker, string weapon)
CodeCallback_NPCKilled(entity npcEntity, entity inflictor, entity attacker, string weapon)
{
combat.Obituary(self.netname, attacker.netname, weapon, "");
combat.Obituary(npcEntity.netname, attacker.netname, weapon, "");
/* update score-counter */
if (ents.isPlayer(attacker)) {
if (self == attacker) {
if (npcEntity == attacker) {
attacker.frags--;
} else {
attacker.frags++;
@ -141,12 +140,12 @@ CodeCallback_NPCKilled(entity inflictor, entity attacker, string weapon)
}
bool
CodeCallback_ImpulseCommand(float impulseNum)
CodeCallback_ImpulseCommand(entity playerEntity, float impulseNum)
{
switch (impulseNum) {
case 100:
if (AllowFlashlight() == true) {
ents.Input(self, "UseItem", "item_suit", self);
ents.Input(playerEntity, "UseItem", "item_suit", playerEntity);
}
break;
default:

View file

@ -19,21 +19,21 @@
#include "../../../src/server/api.h"
void
CodeCallback_PlayerSpawn(void)
CodeCallback_PlayerSpawn(entity playerEntity)
{
ents.ChangeToClass(playerEntity, "player");
game.TeleportToSpawn(self);
}
bool
CodeCallback_PlayerRequestRespawn(void)
CodeCallback_PlayerRequestRespawn(entity playerEntity)
{
localcmd("load quick\n");
return (true);
}
bool
CodeCallback_ImpulseCommand(float impulseNum)
CodeCallback_ImpulseCommand(entity playerEntity, float impulseNum)
{
switch (impulseNum) {
case 100:

View file

@ -141,6 +141,7 @@ HLPlayer::UpdatePlayerAttachments(bool visible)
if (gflags & GF_FLASHLIGHT) {
vector src;
vector ang;
float p;
if (entnum != player_localentnum) {
src = origin + view_ofs;
@ -155,15 +156,17 @@ HLPlayer::UpdatePlayerAttachments(bool visible)
if (autocvar_cg_flashlightClassic == true) {
if (autocvar_r_shadow_realtime_dlight == 0) {
dynamiclight_add(trace_endpos + (trace_plane_normal * 4), 128, [1,1,1]);
p = dynamiclight_add(trace_endpos + (trace_plane_normal * 4), 128, [1,1,1]);
} else {
dynamiclight_add(trace_endpos + (trace_plane_normal * 48.0f), 96, [1,1,1]);
p = dynamiclight_add(trace_endpos + (trace_plane_normal * 48.0f), 96, [1,1,1]);
}
} else {
float p = dynamiclight_add(src + (v_forward * 16), 512, [1,1,1], 0, "textures/flashlight");
p = dynamiclight_add(src + (v_forward * 16), 512, [1,1,1], 0, "textures/flashlight");
dynamiclight_set(p, LFIELD_ANGLES, ang);
dynamiclight_set(p, LFIELD_FLAGS, 3);
}
dynamiclight_set(p, LFIELD_STYLE, 64);
}
/* FIXME: this needs to be incorporated and simplified, now that we can handle it all in-class */

View file

@ -0,0 +1,8 @@
! This archive is part of the Rad-Therapy project !
Dedicated to all those curious, those who love to tinker, those who
grew up on the same maps, mods and worlds... This is for you all!
All contents of this archive are put under the ISC license.
Do what you want, but give credit. No warranties.

View file

@ -8,5 +8,4 @@ entityDef item_battery
"snd_respawn" "item.respawn"
"inv_armor" "skill:battery"
"requires" "item_suit"
"inv_carry" "1"
}

View file

@ -12,5 +12,7 @@ entityDef monster_turret
"speed_walk" "0"
"speed_run" "0"
"static" "1"
"turn_rate" "0"
"use_nav" "0"
"bleed" "0"
}

View file

@ -0,0 +1,5 @@
typeInfo lava
{
"damage" "4"
"dmgtime" "1.0"
}

View file

@ -0,0 +1,5 @@
typeInfo slime
{
"damage" "10"
"dmgtime" "1.0"
}

View file

@ -0,0 +1,4 @@
typeInfo water
{
"damage" "2"
}