NX/VITA: Merge QuakeC sources

This commit is contained in:
Steam Deck User 2023-01-13 19:55:40 -05:00
parent d4efbef54a
commit 76213de449
23 changed files with 67 additions and 798 deletions

View File

@ -17,8 +17,7 @@ jobs:
run: |
zip -r -j pc-nzp-qc.zip pc/*
zip -r -j handheld-nzp-qc.zip handheld/*
zip -r -j nx-nzp-qc.zip nx/*
zip -r -j vita-nzp-qc.zip vita/*
zip -r -j quakespasm-nzp-qc.zip quakespasm/*
- name: Generate Build Date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d-%H-%M-%S')"
@ -41,18 +40,18 @@ jobs:
This is a **bleeding edge** NZ:P QuakeC release, stability is not guarenteed and you may need to grab an updated asset release if this update depends on new models/textures/etc.
To install:
- Grab the .ZIP archive for your desired platform below (*-nzp-qc.zip, use `handheld-nzp-qc.zip` for 3DS and PSP).
- Grab the .ZIP archive for your desired platform below (*-nzp-qc.zip, use `handheld-nzp-qc.zip` for 3DS/PSP and `quakespasm-nzp-qc.zip` for Switch/VITA).
- Extract the contents of the .ZIP archive to your nzp folder (Example: copy `progs.dat` and `progs.lno` to `PSP/GAME/nzportable/nzp`).
draft: true
prerelease: false
- name: Upload NX QC
- name: Upload QUAKESPASM QC
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/nx-nzp-qc.zip
asset_name: nx-nzp-qc.zip
asset_path: ./build/quakespasm-nzp-qc.zip
asset_name: quakespasm-nzp-qc.zip
asset_content_type: application/zip
- name: Upload PC QC
uses: actions/upload-release-asset@v1
@ -72,15 +71,6 @@ jobs:
asset_path: ./build/handheld-nzp-qc.zip
asset_name: handheld-nzp-qc.zip
asset_content_type: application/zip
- name: Upload VITA QC
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/vita-nzp-qc.zip
asset_name: vita-nzp-qc.zip
asset_content_type: application/zip
- name: Publish Release
uses: StuYarrow/publish-release@v1
env:

View File

@ -23,4 +23,4 @@ Before you can build the NZ:P QuakeC, you must either [download](https://github.
To build, simply navigate to the `tools` directory and run the `qc-compiler-*` script for your platform. If unfamiliar with executing shell (`.sh`) scripts on Linux systems, give this [itsFOSS article](https://itsfoss.com/run-shell-script-linux/) a read.
After having done this, a `build` directory will have been created, and inside of it will be more directories named after every platform. Copy the contents of the platform directories into your `nzp` game directory. (Example: copy `progs.dat` and `progs.lno` from `build/psp` to `PSP/GAME/nzportable/nzp`).
After having done this, a `build` directory will have been created, and inside of it will be more directories named after every platform. Copy the contents of the platform directories into your `nzp` game directory. (Example: For PSP, copy `progs.dat` and `progs.lno` from `build/handheld` to `PSP/GAME/nzportable/nzp`).

View File

@ -1,14 +1,14 @@
../../build/nx/progs.dat
../../build/quakespasm/progs.dat
#pragma warning disable Q208
../source/server/defs/nx.qc
../source/server/defs/quakespasm.qc
../source/shared/defs/custom.qc
../source/shared/weapon_defines.qc
../source/server/defs/custom.qc
../source/server/clientfuncs.qc
../source/server/dummies/vitanx.qc
../source/server/dummies/quakespasm.qc
../source/server/dummies/generic.qc
../source/server/rounds.qc

View File

@ -1,44 +0,0 @@
../../build/vita/progs.dat
#pragma warning disable Q208
../source/server/defs/vita.qc
../source/shared/defs/custom.qc
../source/shared/weapon_defines.qc
../source/server/defs/custom.qc
../source/server/clientfuncs.qc
../source/server/dummies/vitanx.qc
../source/server/dummies/generic.qc
../source/server/rounds.qc
../source/server/nzdparser.qc
../source/server/main.qc
../source/server/utilities/command_parser.qc
../source/server/player.qc
../source/server/damage.qc
../source/server/entities/sub_functions.qc
../source/server/entities/sounds.qc
../source/server/entities/triggers.qc
../source/server/entities/explosive_barrel.qc
../source/server/entities/teleporter.qc
../source/server/entities/map_entities.qc
../source/server/entities/traps.qc
../source/server/entities/lights.qc
../source/server/entities/doors.qc
../source/server/entities/window.qc
../source/server/entities/machines.qc
../source/server/weapons/frames_core.qc
../source/server/weapons/weapon_core.qc
../source/server/entities/powerups.qc
../source/server/ai/ai_core.qc
../source/server/ai/standard/waypoints_func.qc
../source/server/ai/standard/waypoints_core.qc
../source/server/ai/zombie_core.qc
../source/server/ai/crawler_core.qc
../source/server/ai/dog_core.qc
../source/server/items.qc

View File

@ -28,7 +28,7 @@
void SetUpdate(entity client, float type, float val1, float val2, float val3)
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
if (type != 2)
{
@ -56,7 +56,7 @@ void SetUpdate(entity client, float type, float val1, float val2, float val3)
}
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
void(entity to, float type, float cost, float weapon) useprint = {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_USEPRINT);
@ -88,7 +88,7 @@ void(vector org) CallExplosion = {
void NotifyNewRound(float to) {
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_NEWROUND);
@ -101,7 +101,7 @@ void NotifyNewRound(float to) {
void SetRound(entity client, float to) {
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_SETROUND);
@ -116,7 +116,7 @@ void SetRound(entity client, float to) {
void SetPerk(entity client, float to)
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_PERK);
@ -131,7 +131,7 @@ void SetPerk(entity client, float to)
void(float to) SwitchWeapon =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_WEAPONCHANGE);
@ -149,7 +149,7 @@ void(float to) SwitchWeapon =
void(string to, float skin) UpdateVmodel =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_UPDATEVMODEL);
@ -165,7 +165,7 @@ void(string to, float skin) UpdateVmodel =
void(string to, float skin) UpdateV2model =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_UPDATEV2MODEL);
@ -180,7 +180,7 @@ void(string to, float skin) UpdateV2model =
void(float index, float state) ChangeReviveIconState =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_REVIVECHANGE);
WriteByte(MSG_MULTICAST, index);
@ -193,7 +193,7 @@ void(float index, float state) ChangeReviveIconState =
void(float index, vector org) EnableReviveIcon =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_REVIVEON);
WriteByte(MSG_MULTICAST, index);
@ -208,7 +208,7 @@ void(float index, vector org) EnableReviveIcon =
void(float index) DisableReviveIcon =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_REVIVEOFF);
WriteByte(MSG_MULTICAST, index);
@ -220,7 +220,7 @@ void(float index) DisableReviveIcon =
void(entity who, float broadcast_time, float type, string str) BroadcastMessageToClient =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
WriteByte(MSG_MULTICAST, broadcast_time);
@ -235,7 +235,7 @@ void(entity who, float broadcast_time, float type, string str) BroadcastMessageT
void(float broadcast_time, float type, string str) BroadcastMessage =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BROADCAST);
WriteByte(MSG_MULTICAST, broadcast_time);
@ -249,7 +249,7 @@ void(float broadcast_time, float type, string str) BroadcastMessage =
void(float playernum, float points, float am, float kills, string name, entity person) UpdatePlayerPoints =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
if (player_count == 0) {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_POINTUPDATE);
@ -278,7 +278,7 @@ void(float playernum, float points, float am, float kills, string name, entity p
void(float count) UpdatePlayerCount = {
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
if (count == 0)
return;
else {
@ -295,7 +295,7 @@ void(float count) UpdatePlayerCount = {
void(float newtime, float newtype, entity change) PromptLevelChange =
{
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_BLACKOUT);
@ -313,7 +313,7 @@ void(entity who) UpdatePunchangle =
// naievil -- shit logic lol...but result looks clean as fuck...
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
WriteByte(MSG_MULTICAST, EVENT_PUNCHANGLE);
WriteCoord(MSG_MULTICAST, who.punchangle_x);
@ -359,7 +359,7 @@ void(entity who) UpdatePunchangle =
}
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
void(string h, float h2, entity who) pushHUD = {
if (player_count == 0) {
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
@ -451,7 +451,7 @@ void(string chaptertitle, string location, string date, string person, entity wh
#endif
#endif
#ifndef NX
#ifndef QUAKESPASM
void (float achievement_id, optional entity who) GiveAchievement =
{
#ifndef PC
@ -526,7 +526,7 @@ void (float achievement_id, float progress_value, optional entity who) UpdateAch
#endif // PC
}
}
#endif // NX
#endif // QUAKESPASM
// *****************************************
// Unrelated to engine, but custom functions

View File

@ -26,9 +26,9 @@
*/
#ifndef NX
#ifndef QUAKESPASM
void (float achievement_id, optional entity who) GiveAchievement;
#endif // NX
#endif // QUAKESPASM
void() Barrel_Hit;
@ -429,7 +429,7 @@ void(entity victim,entity attacker, float damage, float d_style) DamageHandler =
if (victim.crawling != TRUE && !(victim.health <= 0) && crawler_num < 5 && victim.classname != "ai_dog")
{
makeCrawler(victim);
#ifndef NX
#ifndef QUAKESPASM
GiveAchievement(3, attacker);
#endif
}

View File

@ -25,11 +25,11 @@
*/
#ifndef NX
#ifndef QUAKESPASM
#ifndef HANDHELD
#pragma target FTE
#endif // HANDHELD
#endif // NX
#endif // QUAKESPASM
#define true 1
#define false 0
@ -218,7 +218,7 @@ void() SUB_Null2 = {};
#define MAX_ZOMB 24
#ifndef PC
#ifndef NX
#ifndef QUAKESPASM
#define MAX_ZOMB 12
#endif
#endif

View File

@ -33,7 +33,7 @@
==============================================================================
*/
#define NX
#define QUAKESPASM
//
// system globals

View File

@ -1,668 +0,0 @@
/*
defs.qc
global definitions
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA
*/
/*
==============================================================================
SOURCE FOR GLOBALVARS_T C STRUCTURE
==============================================================================
*/
#define NX
#define VITA
//
// system globals
//
entity self;
entity other;
entity world;
float time;
float frametime;
float force_retouch;
string mapname;
float deathmatch;
float coop;
float teamplay;
float serverflags;
float rounds;
float rounds_change;
float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
vector v_forward, v_up, v_right;
float trace_allsolid;
float trace_startsolid;
float trace_fraction;
vector trace_endpos;
vector trace_plane_normal;
float trace_plane_dist;
entity trace_ent;
float trace_inopen;
float trace_inwater;
entity msg_entity; // destination of single entity writes
void() main; // only for testing
void() StartFrame;
void() EndFrame;
void() PlayerPreThink;
void() PlayerPostThink;
void() ClientKill;
void() ClientConnect;
void() PutClientInServer;
void() ClientDisconnect;
void() SetNewParms;
void() SetChangeParms;
void end_sys_globals;
.float modelindex;
.vector absmin, absmax;
.float ltime;
.float movetype;
.float solid;
.vector origin;
.vector oldorigin;
.vector velocity;
.vector angles;
.vector avelocity;
.vector punchangle;
.string classname;
.string model;
.float frame;
.float skin;
.float effects;
.vector mins, maxs;
.vector size;
.void() touch;
.void() use;
.void() think;
.void() blocked;
.float nextthink;
.entity groundentity;
.float health;
.float points;
.float kills;
.float weapon;
.string weaponmodel;
.string weapon2model;
.float weaponframe;
.float weapon2frame;
.float currentammo;
.float currentmag;
.float zoom;
.float weaponskin;
.float weapon2skin;
.float primary_grenades;
.float secondary_grenades;
.float grenades;
.float perks;
.float takedamage;
.entity chain;
.float deadflag;
.vector view_ofs;
.float button0;
.float button1;
.float button2;
.float button3;
.float button4;
.float button5;
.float button6;
.float button7;
.float button8;
.float impulse;
.float fixangle;
.vector v_angle;
.float idealpitch; // Naievil -- new
.string netname;
.entity enemy;
.float flags;
.float colormap;
.float team;
.float max_health;
.float teleport_time;
.float armortype;
.float armorvalue;
.float waterlevel;
.float watertype;
.float ideal_yaw;
.float yaw_speed;
.entity aiment;
.entity head;
.entity larm;
.entity rarm;
.entity goalentity;
.float spawnflags;
.string target;
.string targetname;
.float dmg_take;
.float dmg_save;
.float progress_bar;
.entity dmg_inflictor;
.entity owner;
.vector movedir;
.string message;
.float sounds;
.string noise, noise1, noise2, noise3;
.float x2_icon;
.float insta_icon;
.string Weapon_Name_Touch;
.vector ADS_Offset;
.vector Flash_Offset;
.float Flash_Size;
.float currentmag2;
.float maxspeed;
.float renderGrayscale;
void end_sys_fields;
/*
==============================================================================
VARS NOT REFERENCED BY C CODE
==============================================================================
*/
//
// constants
//
float FALSE = 0;
float TRUE = 1;
// edict.flags
float FL_FLY = 1;
float FL_SWIM = 2;
float FL_CLIENT = 8; // set for all client edicts
float FL_INWATER = 16; // for enter / leave water splash
float FL_MONSTER = 32;
float FL_GODMODE = 64; // player cheat
float FL_NOTARGET = 128; // player cheat
float FL_ITEM = 256; // extra wide size for bonus items
float FL_ONGROUND = 512; // standing on something
float FL_PARTIALGROUND = 1024; // not all corners are valid
float FL_WATERJUMP = 2048; // player jumping out of water
float FL_JUMPRELEASED = 4096; // for jump debouncing
// edict.movetype values
float MOVETYPE_NONE = 0; // never moves
//float MOVETYPE_ANGLENOCLIP = 1;
//float MOVETYPE_ANGLECLIP = 2;
float MOVETYPE_WALK = 3; // players only
float MOVETYPE_STEP = 4; // discrete, not real time unless fall
float MOVETYPE_FLY = 5;
float MOVETYPE_TOSS = 6; // gravity
float MOVETYPE_PUSH = 7; // no clip to world, push and crush
float MOVETYPE_NOCLIP = 8;
float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
float MOVETYPE_BOUNCE = 10;
float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size
// edict.solid values
float SOLID_NOT = 0; // no interaction with other objects
float SOLID_TRIGGER = 1; // touch on edge, but not blocking
float SOLID_BBOX = 2; // touch on edge, block
float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
float SOLID_BSP = 4; // bsp clip, touch on edge, block
float DEAD_NO = 0;
float DEAD_DYING = 1;
float DEAD_DEAD = 2;
float DEAD_RESPAWNABLE = 3;
// takedamage values
float DAMAGE_NO = 0;
float DAMAGE_YES = 1;
float DAMAGE_AIM = 2;
// point content values
float CONTENT_EMPTY = -1;
float CONTENT_SOLID = -2;
float CONTENT_WATER = -3;
float CONTENT_SLIME = -4;
float CONTENT_LAVA = -5;
float CONTENT_SKY = -6;
float STATE_TOP = 0;
float STATE_BOTTOM = 1;
float STATE_UP = 2;
float STATE_DOWN = 3;
vector VEC_ORIGIN = '0 0 0';
// protocol bytes
float SVC_TEMPENTITY = 23;
float SVC_KILLEDMONSTER = 27;
float SVC_FOUNDSECRET = 28;
float SVC_INTERMISSION = 30;
float SVC_FINALE = 31;
float SVC_CDTRACK = 32;
float SVC_SELLSCREEN = 33;
float SVC_SMALLKICK = 34;
float SVC_BIGKICK = 35;
float SVC_MUZZLEFLASH = 39;
// sound channels
// channel 0 never willingly overrides
// other channels (1-7) allways override a playing sound on that channel
float CHAN_AUTO = 0;
float CHAN_WEAPON = 1;
float CHAN_VOICE = 2;
float CHAN_ITEM = 3;
float CHAN_BODY = 4;
float CHAN_NO_PHS_ADD = 8; // ie: CHAN_BODY+CHAN_NO_PHS_ADD
float ATTN_NONE = 0;
float ATTN_NORM = 1;
float ATTN_IDLE = 2;
float ATTN_STATIC = 3;
// entity effects
#define EF_BLUE 1
#define EF_MUZZLEFLASH 2
#define EF_BRIGHTLIGHT 4
#define EF_RED 8
#define EF_ORANGELIGHT 16
#define EF_GREEN 32
#define EF_LIGHT 64
#define EF_NODRAW 128
#define EF_BRIGHTFIELD 256
#define EF_FULLBRIGHT 512
#define EF_DARKLIGHT 1024
#define EF_DARKFIELD 2048
#define EF_PURPLELIGHT 4096
#define EF_RAYRED 8196
#define EF_RAYGREEN 16384
// messages
float MSG_BROADCAST = 0; // unreliable to all
float MSG_ONE = 1; // reliable to one (msg_entity)
float MSG_ALL = 2; // reliable to all
float MSG_INIT = 3; // write to the init string
float MSG_MULTICAST = 4; // for multicast() call
// message levels
float PRINT_LOW = 0; // pickup messages
float PRINT_MEDIUM = 1; // death messages
float PRINT_HIGH = 2; // critical messages
float PRINT_CHAT = 3; // also goes to chat console
// multicast sets
float MULTICAST_ALL = 0; // every client
float MULTICAST_PHS = 1; // within hearing
float MULTICAST_PVS = 2; // within sight
float MULTICAST_ALL_R = 3; // every client, reliable
float MULTICAST_PHS_R = 4; // within hearing, reliable
float MULTICAST_PVS_R = 5; // within sight, reliable
//================================================
//
// globals
//
string string_null; // null string, nothing should be held here
entity activator; // the entity that activated a trigger or brush
float framecount;
//
// cvars checked each frame
//
float teamplay;
float deathmatch;
//================================================
//
// world fields (FIXME: make globals)
//
.string wad;
.string map;
.float worldtype; // 0=medieval 1=metal 2=base
//================================================
.string killtarget;
//
// quakeed fields
//
.float light_lev; // not used by game, but parsed by light util
.float style;
//
// monster ai
//
.void() th_stand;
.void() th_walk;
.void() th_run;
.void() th_missile;
.void() th_melee;
.void(entity attacker, float damage) th_pain;
.void() th_die;
.entity oldenemy; // mad at this player before taking damage
.float speed;
.float lefty;
.float search_time;
.float attack_state;
float AS_STRAIGHT = 1;
float AS_SLIDING = 2;
float AS_MELEE = 3;
float AS_MISSILE = 4;
//
// player only fields
//
.float voided;
.float walkframe;
// Zoid Additions
.float gravity; // Gravity Multiplier (0 to 1.0)
.float attack_finished;
.float pain_finished;
.float invincible_finished;
.float invisible_finished;
.float super_damage_finished;
.float radsuit_finished;
.float invincible_time, invincible_sound;
.float invisible_time, invisible_sound;
.float super_time, super_sound;
.float rad_time;
.float fly_sound;
.float axhitme;
.float show_hostile; // set to time+0.2 whenever a client fires a
// weapon or takes damage. Used to alert
// monsters that otherwise would let the player go
.float jump_flag; // player jump flag
.float swim_flag; // player swimming sound flag
.float air_finished; // when time > air_finished, start drowning
.float bubble_count; // keeps track of the number of bubbles
.string deathtype; // keeps track of how the player died
//
// object stuff
//
.string mdl;
.vector mangle; // angle at start
.vector oldorigin; // only used by secret door
.float t_length, t_width;
//
// doors, etc
//
.vector dest, dest1, dest2;
.float wait; // time from firing to restarting
.float delay; // time from activation to firing
.entity trigger_field; // door's trigger entity
.string noise4;
//
// monsters
//
.float pausetime;
.entity movetarget;
//
// doors
//
.float aflag;
.float dmg; // damage done by door when hit
//
// misc
//
.float cnt; // misc flag
//
// subs
//
.void() think1;
.vector finaldest, finalangle;
//
// triggers
//
.float count; // for counting triggers
//
// plats / doors / buttons
//
.float lip;
.float state;
.vector pos1, pos2; // top and bottom positions
.float height;
//
// sounds
//
.float waitmin, waitmax;
.float distance;
.float volume;
.float sprintflag;
//
// builtin functions
//
void(vector ang) makevectors = #1; // sets v_forward, etc globals
void(entity e, vector o) setorigin = #2;
void(entity e, string m) setmodel = #3; // set movetype and solid first
void(entity e, vector min, vector max) setsize = #4;
void() break = #6;
float() random = #7; // returns 0 - 1
void(entity e, float chan, string samp, float vol, float atten) sound = #8;
vector(vector v) normalize = #9;
void(string e) error = #10;
void(string e) objerror = #11;
float(vector v) vlen = #12;
float(vector v) vectoyaw = #13;
entity() spawn = #14;
void(entity e) remove = #15;
void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
entity() checkclient = #17; // returns a client to look for
entity(entity start, .string fld, string match) find = #18;
string(string s) precache_sound = #19;
string(string s) precache_model = #20;
void(entity client, string s)stuffcmd = #21;
entity(vector org, float rad) findradius = #22;
void(float level, string s) bprint = #23;
void(entity client, float level, string s) sprint = #24;
void(string s) dprint = #25;
string(float f) ftos = #26;
string(vector v) vtos = #27;
void() coredump = #28; // prints all edicts
void() traceon = #29; // turns statment trace on
void() traceoff = #30;
void(entity e) eprint = #31; // prints an entire edict
float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
float(entity zombie, float which, entity limb) updateLimb = #33;
float(float yaw, float dist) droptofloor = #34; // TRUE if landed on floor
void(float style, string value) lightstyle = #35;
float(float v) rint = #36; // round to nearest int
float(float v) floor = #37; // largest integer <= v
float(float v) ceil = #38; // smallest integer >= v
float(entity e) checkbottom = #40; // true if self is on ground
float(vector v) pointcontents = #41; // returns a CONTENT_*
float(float f) fabs = #43;
vector(entity e, float speed) aim = #44; // returns the shooting vector
float(string s) cvar = #45; // return cvar.value
void(string s) localcmd = #46; // put string into local que
entity(entity e) nextent = #47; // for looping through all ents
void() ChangeYaw = #49; // turn towards self.ideal_yaw
vector(vector v) vectoangles = #51;
void(float to, float f) WriteByte = #52;
void(float to, float f) WriteChar = #53;
void(float to, float f) WriteShort = #54;
void(float to, float f) WriteLong = #55;
void(float to, float f) WriteCoord = #56;
void(float to, float f) WriteAngle = #57;
void(float to, string s) WriteString = #58;
void(float to, entity s) WriteEntity = #59;
void(float step) movetogoal = #67;
string(string s) precache_file = #68; // no effect except for -copy
void(entity e) makestatic = #69;
void(string s) changelevel = #70;
void(string var, string val) cvar_set = #72; // sets cvar.value
void(entity client, string s) centerprint = #73; // sprint, but in middle
void(vector pos, string samp, float vol, float atten) ambientsound = #74;
string(string s) precache_model2 = #75; // registered version only
string(string s) precache_sound2 = #76; // registered version only
string(string s) precache_file2 = #77; // registered version only
void(entity e) setspawnparms = #78; // set parm1... to the
void(entity killer, entity killee) logfrag = #79; // add to stats
string(entity e, string key) infokey = #80; // get a key value (world = serverinfo)
float(string s) stof = #81; // convert string to float
void(vector where, float set) multicast = #82;
vector(entity what) Get_Waypoint_Near = #83;
float(entity zombie, entity target) Do_Pathfind_psp = #84;
void(string s) Open_Waypoint = #85;
vector(entity zombie,vector start,vector min, vector max) Get_Next_Waypoint = #86;
void(entity client, float type, float cost, float weapon) useprint = #87;
vector(entity zombie,vector start,vector min, vector max) Get_First_Waypoint = #88;
entity (entity start, .float field, float match) findfloat = #98;
// New NZP custom ones
float(string filename, float mode) fopen = #110;
void(float fhandle) fclose = #111;
string(float fhandle) fgets = #112;
void(float fhandle, string s) fputs = #113;
float(string s) strlen = #114;
string(string s1, string s2) strcat = #115;
string(string s, float start, float length) substring = #116;
vector(string s) stov = #117;
string(string s) strzone = #118;
string(string s) strunzone = #119;
string(string s) strtrim = #120;
float(string s) tokenize = #130; // Was #441
string(float num) argv = #131; // Was #442
void(float intensity_small, float intensity_large, float duration) rumble = #132;
float(entity targ, entity inflictor) CanDamage;
#define FILE_READ 0
#define FILE_APPEND 1
#define FILE_WRITE 2
#define SVC_WEAPONFIRE 35
#define SVC_HITMARK 36
#define SVC_LIMBUPDATE 51 // naievil -- keep me
#define SVC_BSPDECAL 50 // naievil -- keep me
#define SVC_ACHIEVEMENT 52
#define VEC_ORIGIN '0 0 0'
//Standard Quake View Offset
//vector VEC_VIEW_OFS = '0 0 22';
//Half Life View Offset is 64
//64 units above ground, for our purposes it's, 64 - (how low bounding box goes)
vector VEC_VIEW_OFS = '0 0 32';
//Standard Quake Hull
//vector VEC_HULL_MIN = '-16 -16 -24';
//vector VEC_HULL_MAX = '16 16 32';
//Half Life 1 Hull Sizes ADDED BY BLUBS, COMMENTED ORIGINAL QUAKE BBOX SIZS OUT
#define VEC_HULL_MIN '-16 -16 -32'
#define VEC_HULL_MAX '16 16 40'
#define VEC_HULL2_MIN '-32 -32 -24'
#define VEC_HULL2_MAX '32 32 64'
.string fog;
//string world_fog;
.float button3;
.float button4;
.float button5;
.float button6;
.float button7;
.float button8;
.float x2_icon; // double points icon
.float insta_icon;
.vector Flash_Offset;
.float Flash_Size;
.string Weapon_Name;
.float currentHitBoxSetup;
.vector bbmins, bbmaxs; // Used for zombie hitboxes
.entity head;
.entity larm;
.entity rarm;
#define SOLID_CORPSE 5 // bsp clip, touch on edge, block
#define TE_EXPLOSION 3
#define TE_GUNSHOT 2
entity windows[32];
float wincnt;
.float recoil_delay;
float pow(float base, float n) = {
float temp = base;
if (n == 0) {
return 1;
} else {
while (n > 0) {
temp = temp * base;
n = n - 1;
}
return temp;
}
return 0;
};
void enableGrayscale(void) = {
self.renderGrayscale = 1;
}
void disableGrayscale(void) = {
self.renderGrayscale = 0;
}

View File

@ -1,7 +1,7 @@
/*
server/dummies/generic.qc
dummys for vita and nx
dummys for quakespasm
Copyright (C) 2021 NZ:P Team
@ -29,7 +29,7 @@
void GiveAchievement(float achievement_id, optional entity who) = {};
void print(string s) = {};
float (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99; //sB adding tracemove to NX/Vita
float (vector start, vector min, vector max, vector end, float nomonsters, entity forent) tracemove = #99; //sB adding tracemove to quakespasm
void(vector o, vector d, float color, float count) particle = {};

View File

@ -219,7 +219,7 @@ void() PU_NukeFinalize =
entity players;
// give 'The F Bomb'
#ifndef NX
#ifndef QUAKESPASM
if (self.kills == 1) {
GiveAchievement(4);
}

View File

@ -69,7 +69,7 @@ void () ambient_generic =
{
local string link;
// moto - FIXME: typically this is set to upper-case but NX and HANDHELD lack strtoupper(); assume lower-case!
// moto - FIXME: typically this is set to upper-case but QUAKESPASM and HANDHELD lack strtoupper(); assume lower-case!
link = self.message;
if (link == "nolink") {

View File

@ -175,6 +175,9 @@ void zapper_stop() {
self = tempe;
} else if (zents.classname == "zapper_node" && zents.target) {
zents.think = SUB_Null;
entity zent_target = find(world, targetname, self.target);
if (zent_target != world)
zent_target.touch = SUB_Null;
zents.nextthink = 0;
}
zents.touch = SUB_Null;
@ -208,7 +211,7 @@ void zapper_start(string zapper) {
tempe = spawn();
tempe.think = zapper_stop;
tempe.nextthink = time + self.calc_time;
tempe.nextthink = time + 2;
tempe.zappername = zapper;
}

View File

@ -129,7 +129,7 @@ void() precaches =
precache_model ("models/player.mdl");
#ifndef HANDHELD
#ifndef NX
#ifndef QUAKESPASM
if (world.song != "")
precache_sound (world.song);
#endif

View File

@ -247,7 +247,7 @@ void(string weaponFile) nzd_defineweapon = {
//basically copying the waypoint code.. yikes
void() load_nzd = {
#ifndef NX
#ifndef QUAKESPASM
float file, point;
string h;
float loop;

View File

@ -429,7 +429,7 @@ void() PlayerPostThink =
// Perform a traceline to keep track of entities directly
// in front of the player.
#ifndef NX
#ifndef QUAKESPASM
vector source;
makevectors (self.v_angle);

View File

@ -244,14 +244,14 @@ void() NewRound =
Remaining_Zombies = Total_Zombies = getZombieTotal();
#ifndef NX
#ifndef QUAKESPASM
switch(rounds) {
case 5: GiveAchievement(0); break;
case 10: GiveAchievement(1); break;
case 15: GiveAchievement(2); break;
default: break;
}
#endif // NX
#endif // QUAKESPASM
// Set up delay for zombie spawning
local float spawndelay;

View File

@ -67,7 +67,7 @@ void() W_AimIn =
if (self.weapon == W_KAR_SCOPE || self.weapon == W_PTRS ||
self.weapon == W_HEADCRACKER || self.weapon == W_PENETRATOR) {
SetUpdate(self, UT_ZOOM2, 0, 0, 0);
#ifdef NX
#ifdef QUAKESPASM
self.zoom = 1;
#else
self.zoom = 2;
@ -145,7 +145,7 @@ void W_SprintStart () {
else
self.sprint_duration -= self.sprint_rest_time;
#ifdef NX
#ifdef QUAKESPASM
if (!self.sprintflag) {
return;
}
@ -2154,7 +2154,7 @@ void () Impulse_Functions =
else
Change_Stance();
break;
#ifdef NX
#ifdef QUAKESPASM
case 31:
self.sprintflag = 0;
break;
@ -2270,7 +2270,7 @@ void() CheckPlayer =
CheckPowerups(self);
CheckRevive(self);
#ifdef NX
#ifdef QUAKESPASM
if (!self.sprintflag && self.sprinting) {
W_SprintStop();
}

View File

@ -54,8 +54,8 @@ const float EVENT_REVIVEON = 37;
const float EVENT_REVIVEOFF = 38;
const float EVENT_REVIVECHANGE = 39;
// Define our PC version if we don't have NX or PSP
#ifndef NX
// Define our PC version
#ifndef QUAKESPASM
#ifndef HANDHELD
#define PC
#endif
@ -231,7 +231,7 @@ float invertfloat(float input) {
}
//elements
#ifndef NX
#ifndef QUAKESPASM
string G_HUD;
float G_HUDHOR;
#endif

View File

@ -29,8 +29,8 @@
#define CHAN_MUSIC 1
#define CHAN_SFX 2
#ifndef PSP
#ifndef NX
#ifndef HANDHELD
#ifndef QUAKESPASM
void(string soundname, optional float channel, optional float volume) localsound_enhanced =
{
if (!volume)

View File

@ -4003,7 +4003,7 @@ vector(float wep) GetWeaponRecoil =
temp1 = change_1 + change_2;
temp2 = change_1 + change_2 + change_3;
#ifndef PSP
#ifndef HANDHELD
if (r < change_1)
final_kick_y = kick_change_x*0.25;
else if (r < temp1)
@ -4035,7 +4035,7 @@ vector(float wep) GetWeaponRecoil =
vector (float wep) GetWeaponFlash_Offset =
{
switch(wep) {
#ifndef NX
#ifndef QUAKESPASM
case W_COLT:
return [5488, -2742, 35300];
case W_BIATCH:
@ -4102,7 +4102,7 @@ vector (float wep) GetWeaponFlash_Offset =
return [5488, -2742, 35300];
#endif
#ifdef NX
#ifdef QUAKESPASM
case W_COLT:
case W_BIATCH:
return [1950, -6250, 35300];

View File

@ -2,7 +2,7 @@
cd ../
# create build directories
mkdir -p build/{pc,handheld,nx,vita}
mkdir -p build/{pc,handheld,quakespasm,vita}
cd bin/
echo ""
echo "========================"
@ -24,13 +24,7 @@ echo ""
./fteqcc-cli-lin -srcfile ../progs/handheld.src
echo ""
echo "========================"
echo " compiling NX-QS QC "
echo "compiling QUAKESPASM QC "
echo "========================"
echo ""
./fteqcc-cli-lin -srcfile ../progs/nx.src
echo ""
echo "========================"
echo " compiling VITA QC "
echo "========================"
echo ""
./fteqcc-cli-lin -srcfile ../progs/vita.src
./fteqcc-cli-lin -srcfile ../progs/quakespasm.src

View File

@ -3,7 +3,7 @@ CD ../
REM ****** create build directories ******
MKDIR build\pc\ 2>nul
MKDIR build\handheld\ 2>nul
MKDIR build\nx\ 2>nul
MKDIR build\quakespasm\ 2>nul
MKDIR build\vita\ 2>nul
CD bin/
echo.
@ -26,14 +26,8 @@ echo.
fteqcc-cli-win.exe -srcfile ../progs/handheld.src
echo.
echo ========================
echo compiling NX-QS QC
echo compiling QUAKESPASM QC
echo ========================
echo.
fteqcc-cli-win.exe -srcfile ../progs/nx.src
echo.
echo ========================
echo compiling VITA QC
echo ========================
echo.
fteqcc-cli-win.exe -srcfile ../progs/vita.src
fteqcc-cli-win.exe -srcfile ../progs/quakespasm.src
pause