├── quakec_ctf ├── progs.src ├── log.qc ├── bots │ └── bot.qc ├── itemnames.qc ├── progdefs.h ├── status.qc ├── server.qc ├── buttons.qc └── ctfgame.qc ├── quakec ├── progs.src ├── bots │ └── bot.qc ├── itemnames.qc └── buttons.qc ├── quakec_hipnotic ├── flag.qc ├── jctest.qc ├── progs.src ├── hipspr.qc ├── sprites.qc ├── bots │ └── bot.qc ├── hipwater.qc ├── hipspike.qc ├── hipquake.qc ├── amtest.qc ├── hipclock.qc ├── hip_brk.qc ├── hip_push.qc ├── hipholes.qc ├── hipdefs.qc ├── hiprubbl.qc ├── buttons.qc ├── hipmodel.qc ├── hipcount.qc ├── hipdecoy.qc ├── hiptrain.qc └── hip_expl.qc ├── quakec_rogue ├── progs.src ├── sprites.qc ├── bots │ └── bot.qc ├── shield.qc ├── motd.qc ├── random.qc ├── newitems.qc ├── buttons.qc ├── newmisc.qc ├── elevatr.qc ├── buzzsaw.qc ├── earthq.qc ├── sphere.qc ├── new_ai.qc ├── lightnin.qc ├── dmatch.qc └── lava_wpn.qc ├── README.md └── quakec_mg1 ├── map_specific ├── hub.qc └── mge2m2.qc ├── progs.src ├── frametick.qc ├── math.qc ├── misc_model.qc ├── func_fade.qc ├── func_bob.qc ├── misc_corpses.qc ├── rotate.qc └── items_runes.qc /quakec_ctf/progs.src: -------------------------------------------------------------------------------- 1 | ../qsrc/ctf/progs.dat 2 | 3 | defs.qc 4 | log.qc // Console logging of game actions 5 | teamplay.qc // Compile the teamplay file 6 | ctfgame.qc // vote exit stuff 7 | status.qc // team status stuff 8 | subs.qc 9 | combat.qc 10 | itemnames.qc 11 | items.qc 12 | observ.qc 13 | weapons.qc 14 | world.qc 15 | client.qc 16 | player.qc 17 | doors.qc 18 | buttons.qc 19 | triggers.qc 20 | plats.qc 21 | misc.qc 22 | hook.qc 23 | server.qc 24 | bots/bot.qc -------------------------------------------------------------------------------- /quakec/progs.src: -------------------------------------------------------------------------------- 1 | ../progs.dat 2 | 3 | defs.qc 4 | subs.qc 5 | fight.qc 6 | ai.qc 7 | combat.qc 8 | itemnames.qc 9 | items.qc 10 | weapons.qc 11 | world.qc 12 | client.qc 13 | player.qc 14 | monsters.qc 15 | doors.qc 16 | buttons.qc 17 | triggers.qc 18 | plats.qc 19 | misc.qc 20 | 21 | monsters/ogre.qc 22 | monsters/fiend.qc 23 | monsters/shambler.qc 24 | monsters/knight.qc 25 | monsters/grunt.qc 26 | monsters/scrag.qc 27 | monsters/rottweiler.qc 28 | monsters/zombie.qc 29 | monsters/chthon.qc 30 | 31 | monsters/spawn.qc // registered 32 | monsters/hellknight.qc // registered 33 | monsters/rotfish.qc // registered 34 | monsters/vore.qc // registered 35 | monsters/enforcer.qc // registered 36 | monsters/shub.qc // registered 37 | 38 | bots/bot.qc // bot support 39 | -------------------------------------------------------------------------------- /quakec_hipnotic/flag.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /*QUAKED item_deathball (.3 .3 1) (0 0 0) (32 32 32) 21 | */ 22 | void() deathball_touch; 23 | 24 | void() item_deathball = 25 | { 26 | self.touch = deathball_touch; 27 | }; -------------------------------------------------------------------------------- /quakec_rogue/progs.src: -------------------------------------------------------------------------------- 1 | progs.dat 2 | 3 | defs.qc 4 | teamplay.qc // ZOID - teamplay stuff 5 | runes.qc 6 | motd.qc 7 | subs.qc 8 | fight.qc 9 | ai.qc 10 | combat.qc 11 | items.qc 12 | grapple.qc // ZOID - grappling hook 13 | weapons.qc 14 | world.qc 15 | client.qc 16 | player.qc 17 | monsters.qc 18 | doors.qc 19 | buttons.qc 20 | triggers.qc 21 | plats.qc 22 | misc.qc 23 | 24 | ogre.qc 25 | demon.qc 26 | shambler.qc 27 | knight.qc 28 | soldier.qc 29 | wizard.qc 30 | dog.qc 31 | zombie.qc 32 | boss.qc 33 | 34 | tarbaby.qc // registered 35 | hknight.qc // registered 36 | fish.qc // registered 37 | shalrath.qc // registered 38 | enforcer.qc // registered 39 | oldone.qc // registered 40 | 41 | new_ai.qc 42 | eel.qc 43 | invis_sw.qc 44 | newitems.qc 45 | newplats.qc 46 | newmisc.qc 47 | elevatr.qc 48 | pendulum.qc 49 | lightnin.qc 50 | wrath.qc 51 | shield.qc 52 | lava_wpn.qc 53 | mult_wpn.qc 54 | dragon.qc 55 | s_wrath.qc 56 | random.qc 57 | earthq.qc 58 | lavaman.qc 59 | sphere.qc 60 | buzzsaw.qc 61 | dmatch.qc 62 | morph.qc 63 | 64 | ending.qc 65 | mummy.qc 66 | timemach.qc 67 | 68 | bots/bot.qc // bot support 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Quake Rerelease QuakeC Source Code 2 | 3 | This repository contains the QuakeC source code for the five codebases that were used in the 2021 re-release of Quake: the base campaign, Scourge of Armagon, Dissolution of Eternity, Dimension of the Machine, and Capture the Flag. Dimension of the Past shares the same codebase as Dimension of the Machine. 4 | 5 | In comparison with the original QuakeC, these codebases have been updated to replace all instances of strings with placeholder strings that can be used for localization. This requires some support on the engine side in order to handle printing messages correctly. There have also been bug fixes and modifications to behaviors from the original game. 6 | 7 | These progs also use some advanced QuakeC features that are only available in modern compilers. We recommend using [FTEQCC](https://www.fteqcc.org) for compiling this release. 8 | 9 | This code is released under the GPLv2 license. See `COPYING.txt` for more details. 10 | 11 | id Software is unable to provide support for this release, however we urge you to take advantage of the depth of community-driven resources already available. -------------------------------------------------------------------------------- /quakec_mg1/map_specific/hub.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | void hub_trigger_changelevel() 22 | { 23 | if((serverflags & SIGIL_ALL) !=SIGIL_ALL) 24 | { 25 | remove(self); 26 | return; 27 | } 28 | 29 | trigger_changelevel(); 30 | } 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /quakec_hipnotic/jctest.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | void() jctrig = 22 | { 23 | dprint ("here\n\n"); 24 | lightstyle(0, "az"); 25 | }; 26 | 27 | /*QUAKED trigger_jctest (.5 .5 .5) ? 28 | */ 29 | void() trigger_jctest = 30 | { 31 | setsize (self, self.mins, self.maxs); 32 | self.solid = SOLID_EDGE; 33 | self.touch = jctrig; 34 | }; 35 | -------------------------------------------------------------------------------- /quakec_hipnotic/progs.src: -------------------------------------------------------------------------------- 1 | ../progs.dat 2 | 3 | defs.qc 4 | hipdefs.qc //JIM 5 | subs.qc 6 | fight.qc 7 | ai.qc 8 | combat.qc 9 | items.qc 10 | weapons.qc 11 | world.qc 12 | client.qc 13 | player.qc 14 | monsters.qc 15 | doors.qc 16 | buttons.qc 17 | triggers.qc 18 | plats.qc 19 | misc.qc 20 | 21 | monsters/ogre.qc 22 | monsters/fiend.qc 23 | monsters/shambler.qc 24 | monsters/knight.qc 25 | monsters/grunt.qc 26 | monsters/scrag.qc 27 | monsters/rottweiler.qc 28 | monsters/zombie.qc 29 | monsters/chthon.qc 30 | 31 | monsters/spawn.qc // registered 32 | monsters/hellknight.qc // registered 33 | monsters/rotfish.qc // registered 34 | monsters/vore.qc // registered 35 | monsters/enforcer.qc // registered 36 | monsters/shub.qc // registered 37 | 38 | // Hipnotic Quake additions 39 | 40 | hipsubs.qc 41 | hip_brk.qc 42 | hiptrain.qc 43 | hip_expl.qc 44 | hipquake.qc 45 | hipcount.qc 46 | hipitems.qc 47 | hiprubbl.qc 48 | hip_push.qc 49 | hip_part.qc 50 | hipspawn.qc 51 | hipgrem.qc 52 | hiparma.qc 53 | hipspike.qc 54 | hiprot.qc 55 | hipscrge.qc 56 | hipholes.qc 57 | hipclock.qc 58 | hiptrig.qc 59 | hipmisc.qc 60 | hipwater.qc 61 | hipdecoy.qc 62 | 63 | bots/bot.qc // bot support 64 | 65 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipspr.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Sprites QuickC program 21 | By Jim Dose' 11/20/96 22 | */ 23 | 24 | // Bullethole 25 | $spritename s_bullet 26 | $type oriented 27 | $load h:/quake/hipwork/gfx/sprites/blood.lbm 28 | $frame 96 16 8 8 29 | 30 | // Blood Splat 31 | $spritename s_blood1 32 | $type oriented 33 | $load h:/quake/hipwork/gfx/sprites/blood.lbm 34 | $frame 32 32 56 56 35 | -------------------------------------------------------------------------------- /quakec_hipnotic/sprites.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | // these are the only sprites still in the game... 22 | 23 | $spritename s_explod 24 | $type vp_parallel 25 | $load id1/gfx/sprites/explod03.lbm 26 | $frame 24 24 56 56 27 | $frame 120 24 56 56 28 | $frame 216 24 56 56 29 | $frame 24 88 56 56 30 | $frame 120 88 56 56 31 | $frame 216 88 56 56 32 | 33 | 34 | $spritename s_bubble 35 | $type vp_parallel 36 | $load id1/gfx/sprites/bubble.lbm 37 | $frame 16 16 16 16 38 | $frame 40 16 16 16 39 | 40 | 41 | $spritename s_light 42 | $type vp_parallel 43 | $load id1/gfx/sprites/light.lbm 44 | $frame 104 32 32 32 45 | 46 | -------------------------------------------------------------------------------- /quakec_rogue/sprites.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | // these are the only sprites still in the game... 22 | 23 | $spritename s_explod 24 | $type vp_parallel 25 | $load /raid/quake/id1/gfx/sprites/explod03.lbm 26 | $frame 24 24 56 56 27 | $frame 120 24 56 56 28 | $frame 216 24 56 56 29 | $frame 24 88 56 56 30 | $frame 120 88 56 56 31 | $frame 216 88 56 56 32 | 33 | 34 | $spritename s_bubble 35 | $type vp_parallel 36 | $load /raid/quake/id1/gfx/sprites/bubble.lbm 37 | $frame 16 16 16 16 38 | $frame 40 16 16 16 39 | 40 | 41 | $spritename s_light 42 | $type vp_parallel 43 | $load /raid/quake/id1/gfx/sprites/light.lbm 44 | $frame 104 32 32 32 45 | 46 | -------------------------------------------------------------------------------- /quakec_rogue/bots/bot.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ======================== 22 | Bot_PreThink 23 | 24 | Called by the engine every frame before running the bots update in C++ 25 | 26 | Example usages of this function: 27 | 28 | 1. Telling bots what to do or where to go. 29 | 2. Modifying properties on the bot player ( or other players in-game ) that the bots can see/use doing their update. 30 | ======================== 31 | */ 32 | void Bot_PreThink() { 33 | 34 | 35 | }; 36 | 37 | /* 38 | ======================== 39 | Bot_PostThink 40 | 41 | Called by the engine every frame after running the bots update in C++ 42 | 43 | Example usages of this function: 44 | 45 | 1. Overriding/modifying bot user cmds. 46 | 2. Overriding/modifying bot player properties. 47 | ======================== 48 | */ 49 | void Bot_PostThink() { 50 | 51 | 52 | }; -------------------------------------------------------------------------------- /quakec_hipnotic/bots/bot.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ======================== 22 | Bot_PreThink 23 | 24 | Called by the engine every frame before running the bots update in C++ 25 | 26 | Example usages of this function: 27 | 28 | 1. Telling bots what to do or where to go. 29 | 2. Modifying properties on the bot player ( or other players in-game ) that the bots can see/use doing their update. 30 | ======================== 31 | */ 32 | void Bot_PreThink() { 33 | 34 | 35 | }; 36 | 37 | /* 38 | ======================== 39 | Bot_PostThink 40 | 41 | Called by the engine every frame after running the bots update in C++ 42 | 43 | Example usages of this function: 44 | 45 | 1. Overriding/modifying bot user cmds. 46 | 2. Overriding/modifying bot player properties. 47 | ======================== 48 | */ 49 | void Bot_PostThink() { 50 | 51 | 52 | }; -------------------------------------------------------------------------------- /quakec_ctf/log.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | void(entity targ, entity attacker, string what) LogPlayerDMDeath = 21 | { 22 | // note embedded tabs in the next string 23 | localcmd("echo "); 24 | localcmd("LOG: DEATH "); 25 | localcmd(targ.netname); 26 | localcmd("/"); 27 | localcmd(ftos(targ.frags)); 28 | localcmd(" "); 29 | localcmd(attacker.netname); 30 | localcmd("/"); 31 | localcmd(ftos(attacker.frags)); 32 | localcmd(" "); 33 | localcmd(what); 34 | localcmd("\n"); 35 | }; 36 | 37 | void (entity targ, string what) LogPlayerDeath = 38 | { 39 | localcmd("echo "); 40 | localcmd("LOG: DEATH "); 41 | localcmd(targ.netname); 42 | localcmd("/"); 43 | localcmd(ftos(targ.frags)); 44 | localcmd(" "); 45 | localcmd(what); 46 | localcmd("\n"); 47 | }; 48 | 49 | void (entity who, string what) LogMsg = 50 | { 51 | localcmd("echo "); 52 | localcmd("LOG: "); 53 | localcmd(what); 54 | localcmd(" "); 55 | localcmd(who.netname); 56 | localcmd("\n"); 57 | }; 58 | -------------------------------------------------------------------------------- /quakec/bots/bot.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ======================== 22 | Bot_PreThink 23 | 24 | Called by the engine every frame before running the bots update in C++ 25 | 26 | NOTE: "self" will be the calling bot 27 | 28 | Example usages of this function: 29 | 30 | 1. Telling bots what to do or where to go ( i.e. setting a high level goal ). 31 | 2. Modifying properties on the bot player ( or other players in-game ) that the bots can see/use doing their update. 32 | ======================== 33 | */ 34 | void Bot_PreThink() { 35 | // add your code here! 36 | }; 37 | 38 | /* 39 | ======================== 40 | Bot_PostThink 41 | 42 | Called by the engine every frame after running the bots update in C++ 43 | 44 | NOTE: "self" will be the calling bot 45 | 46 | Example usages of this function: 47 | 48 | 1. Overriding/modifying bot user cmds. 49 | 2. Overriding/modifying bot player properties. 50 | ======================== 51 | */ 52 | void Bot_PostThink() { 53 | // add your code here! 54 | }; -------------------------------------------------------------------------------- /quakec_ctf/bots/bot.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ======================== 22 | Bot_PreThink 23 | 24 | Called by the engine every frame before running the bots update in C++ 25 | 26 | NOTE: "self" will be the calling bot 27 | 28 | Example usages of this function: 29 | 30 | 1. Telling bots what to do or where to go ( i.e. setting a high level goal ). 31 | 2. Modifying properties on the bot player ( or other players in-game ) that the bots can see/use doing their update. 32 | ======================== 33 | */ 34 | void Bot_PreThink() { 35 | // add your code here! 36 | }; 37 | 38 | /* 39 | ======================== 40 | Bot_PostThink 41 | 42 | Called by the engine every frame after running the bots update in C++ 43 | 44 | NOTE: "self" will be the calling bot 45 | 46 | Example usages of this function: 47 | 48 | 1. Overriding/modifying bot user cmds. 49 | 2. Overriding/modifying bot player properties. 50 | ======================== 51 | */ 52 | void Bot_PostThink() { 53 | // add your code here! 54 | }; -------------------------------------------------------------------------------- /quakec_mg1/progs.src: -------------------------------------------------------------------------------- 1 | #output "../progs.dat" 2 | 3 | #copyright "Machinegames 2021" 4 | 5 | // Enables downed zombies to be gibbed by nearby explosions 6 | // #define GIB_DOWNED_ZOMBIES 7 | 8 | // Enables grenade downward slope bounce fix 9 | #define GRENADE_BOUNCE_FIX 10 | 11 | // Enables monsters being aware of being in dangerous liquids 12 | #define MONSTERS_AWARE_OF_CONTENTS 13 | 14 | // Enables experimental coop respawn behaviour: items respawn times so all players have a chance to pick them up 15 | #define COOP_RESPAWN_ITEMS_FOR_PLAYERS 16 | 17 | // Enables experimental coop respawn behaviour: keep all the players weapons when a checkpoint is activated 18 | #define COOP_RESPAWN_KEEP_WEAPONS 19 | 20 | // Makes it so that killing an entity that has a delayed trigger behaviour while the delay is pending also cancels the delayed trigger 21 | #define ALLOW_DELAYED_THINK_CANCEL 22 | 23 | #includelist 24 | 25 | defs.qc 26 | math.qc 27 | subs.qc 28 | frametick.qc 29 | fight.qc 30 | ai.qc 31 | combat.qc 32 | items.qc 33 | items_runes.qc 34 | weapons.qc 35 | fog.qc // Fog controls 36 | world.qc 37 | client.qc 38 | player.qc 39 | monsters.qc 40 | doors.qc 41 | buttons.qc 42 | triggers.qc 43 | plats.qc 44 | misc.qc 45 | func_bob.qc 46 | lights.qc 47 | rotate.qc 48 | func_toss.qc 49 | // func_fade.qc // Bad behavior 50 | 51 | 52 | monsters/ogre.qc 53 | monsters/demon.qc 54 | monsters/shambler.qc 55 | monsters/knight.qc 56 | monsters/soldier.qc 57 | monsters/wizard.qc 58 | monsters/dog.qc 59 | monsters/zombie.qc 60 | monsters/boss.qc 61 | 62 | monsters/tarbaby.qc // registered 63 | monsters/hknight.qc // registered 64 | monsters/fish.qc // registered 65 | monsters/shalrath.qc // registered 66 | monsters/enforcer.qc // registered 67 | monsters/oldone.qc // registered 68 | 69 | misc_corpses.qc //Corpses yay 70 | misc_fx.qc // adds screenshake 71 | misc_model.qc //generic static and animated model 72 | 73 | //Map specific code? Why not.. 74 | map_specific/mge2m2.qc 75 | map_specific/hub.qc 76 | 77 | horde.qc // Yoder readded Sept 24, 2021 78 | 79 | #endlist -------------------------------------------------------------------------------- /quakec_mg1/frametick.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | entity frametick_head; 22 | .entity frametick_next; 23 | 24 | void RegisterFrameTickEntity(entity ent) 25 | { 26 | if(!ent.tick) 27 | { 28 | entity oself = self; 29 | self = ent; 30 | objerror("Registered frame tick entity doesn't have tick function.\n"); 31 | self = oself; 32 | } 33 | ent.frametick_next = frametick_head; 34 | frametick_head = ent; 35 | } 36 | 37 | void RemoveFrameTickEntity(entity rem) 38 | { 39 | if(!rem.tick) return; 40 | 41 | if(rem == frametick_head){ 42 | frametick_head = rem.frametick_next; 43 | rem.frametick_next = world; 44 | return; 45 | } 46 | 47 | entity ent = frametick_head; 48 | while(ent) 49 | { 50 | if(ent.frametick_next == rem) 51 | { 52 | ent.frametick_next = rem.frametick_next; 53 | rem.frametick_next = world; 54 | return; 55 | } 56 | ent = ent.frametick_next; 57 | } 58 | } 59 | 60 | void RunFrameTickEntities(float deltaTime) 61 | { 62 | entity oself = self; 63 | entity ent = frametick_head; 64 | while(ent) 65 | { 66 | self = ent; 67 | ent = self.frametick_next; 68 | self.tick(deltaTime); 69 | } 70 | self = oself; 71 | } 72 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipwater.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Water QuickC program 21 | By Jim Dose' 12/16/96 22 | */ 23 | 24 | void() bobbingwater_think = 25 | { 26 | local vector ang; 27 | 28 | self.count = self.count + self.speed * ( time - self.ltime ); 29 | if ( self.count > 360 ) 30 | { 31 | self.count = self.count - 360; 32 | } 33 | ang_x = self.count; 34 | ang_y = 0; 35 | ang_z = 0; 36 | makevectors( ang ); 37 | self.origin_z = v_forward_z * self.cnt; 38 | setorigin( self, self.origin ); 39 | self.ltime = time; 40 | self.nextthink = time + 0.02; 41 | }; 42 | 43 | /*QUAKED func_bobbingwater (0 .5 .8) ? 44 | Used to emulate water. To use, create a thin water brush and center it 45 | on the water line of the body of water to bob. The amount of the bob 46 | is the depth of the brush. 47 | 48 | "speed" is how long in seconds it takes the brush to do one full bob. 49 | */ 50 | void() func_bobbingwater = 51 | { 52 | self.angles = '0 0 0'; 53 | self.movetype = MOVETYPE_STEP; 54 | self.solid = SOLID_NOT; 55 | setmodel (self,self.model); 56 | self.think = bobbingwater_think; 57 | 58 | self.count = 0; 59 | self.cnt = self.size_z / 2; 60 | if ( !self.speed ) 61 | { 62 | self.speed = 4; 63 | } 64 | 65 | self.speed = 360 / self.speed; 66 | 67 | self.nextthink = time + 0.02; 68 | self.ltime = time; 69 | }; 70 | -------------------------------------------------------------------------------- /quakec_mg1/math.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /////////////////////////////////////////////////////////// 21 | // Math related functions 22 | /////////////////////////////////////////////////////////// 23 | 24 | /////////////////////////////////////////////////////////// 25 | // Modulus 26 | 27 | float mod(float v, float m) 28 | { 29 | float r; 30 | 31 | if(m == 0) objerror("Illegal op: mod(x, 0)!"); 32 | if(fabs(v) < m) return v; 33 | if(v == m) return 0; 34 | 35 | r = floor(v / m) * m; 36 | 37 | return v - r; 38 | } 39 | 40 | /////////////////////////////////////////////////////////// 41 | // Sine 42 | 43 | float sin(float angle) 44 | { 45 | vector a = {0, angle, 0}; 46 | makevectors(a); 47 | return v_forward_y; 48 | } 49 | 50 | /////////////////////////////////////////////////////////// 51 | // Cosine 52 | 53 | float cos(float angle) 54 | { 55 | vector a = {0, angle, 0}; 56 | makevectors(a); 57 | return v_forward_x; 58 | } 59 | 60 | /* 61 | ================ 62 | Bitshift emulation 63 | ================ 64 | */ 65 | 66 | float SUB_LeftShift(float num, float bits) 67 | { 68 | bits = floor(bits); 69 | while(bits > 0) 70 | { 71 | num*= 2; 72 | bits--; 73 | } 74 | return num; 75 | } 76 | 77 | float SUB_RightShift(float num, float bits) 78 | { 79 | bits = floor(bits); 80 | while(bits > 0) 81 | { 82 | num/= 2; 83 | bits--; 84 | } 85 | return num; 86 | } 87 | -------------------------------------------------------------------------------- /quakec/itemnames.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | string GetNetName( float item_number ) = { 21 | switch ( item_number ) { 22 | case IT_AXE: 23 | return "Axe"; 24 | case IT_SHOTGUN: 25 | return "Shotgun"; 26 | case IT_SUPER_SHOTGUN: 27 | return "Super Shotgun"; 28 | case IT_NAILGUN: 29 | return "Nailgun"; 30 | case IT_SUPER_NAILGUN: 31 | return "Perforator"; 32 | case IT_GRENADE_LAUNCHER: 33 | return "Grenade Launcher"; 34 | case IT_ROCKET_LAUNCHER: 35 | return "Rocket Launcher"; 36 | case IT_LIGHTNING: 37 | return "Lightning Gun"; 38 | case IT_EXTRA_WEAPON: 39 | return "Extra Weapon"; 40 | case IT_SHELLS: 41 | return "Shells"; 42 | case IT_NAILS: 43 | return "Nails"; 44 | case IT_ROCKETS: 45 | return "Rockets"; 46 | case IT_CELLS: 47 | return "Cells"; 48 | case IT_ARMOR1: 49 | return "Green Armor"; 50 | case IT_ARMOR2: 51 | return "Yellow Armor"; 52 | case IT_ARMOR3: 53 | return "Red Armor"; 54 | case IT_SUPERHEALTH: 55 | return "Mega Health"; 56 | case IT_KEY1: { 57 | if ( world.worldtype == WORLDTYPE_MEDIEVAL ) 58 | return "Silver key"; 59 | else if ( world.worldtype == WORLDTYPE_METAL ) 60 | return "Silver runkey"; 61 | else if ( world.worldtype == WORLDTYPE_BASE ) 62 | return "Silver keycard"; 63 | } 64 | case IT_KEY2: { 65 | if ( world.worldtype == WORLDTYPE_MEDIEVAL ) 66 | return "Gold key"; 67 | else if ( world.worldtype == WORLDTYPE_METAL ) 68 | return "Gold runkey"; 69 | else if ( world.worldtype == WORLDTYPE_BASE ) 70 | return "Gold keycard"; 71 | } 72 | case IT_INVISIBILITY: 73 | return "Ring of Shadows"; 74 | case IT_INVULNERABILITY: 75 | return "Pentagram of Protection"; 76 | case IT_SUIT: 77 | return "Biohazard Suit"; 78 | case IT_QUAD: 79 | return "Quad Damage"; 80 | 81 | default: 82 | return string_null; 83 | } 84 | }; -------------------------------------------------------------------------------- /quakec_mg1/misc_model.qc: -------------------------------------------------------------------------------- 1 | 2 | const float MISC_MODEL_ANIMATED = 1; 3 | const float MISC_MODEL_ANIMATED_ONCE = 2; 4 | const float MISC_MODEL_ANIMATED_START_OFF = 4; 5 | 6 | /////////////////////////////// 7 | // Behaviour for a looping animation 8 | /////////////////////////////// 9 | 10 | void misc_model_think_loop() 11 | { 12 | self.frame += 1; 13 | if(self.frame == self.cnt) 14 | { 15 | self.frame = self.count; // Back to start 16 | } 17 | self.nextthink = time + 0.1; 18 | } 19 | 20 | void misc_model_use_loop() 21 | { 22 | if(self.spawnflags & MISC_MODEL_ANIMATED_START_OFF) 23 | { 24 | self.spawnflags (-) MISC_MODEL_ANIMATED_START_OFF; 25 | self.think = misc_model_think_loop; 26 | misc_model_think_loop(); 27 | } 28 | else 29 | { 30 | self.spawnflags (+) MISC_MODEL_ANIMATED_START_OFF; 31 | self.think = SUB_Null; 32 | self.nextthink = -1; 33 | } 34 | 35 | } 36 | 37 | /////////////////////////////// 38 | // Behaviour for a single animation 39 | /////////////////////////////// 40 | 41 | void misc_model_think_once() 42 | { 43 | self.frame += 1; 44 | if(self.frame < self.cnt) 45 | { 46 | self.nextthink = time + 0.1; 47 | } 48 | } 49 | 50 | void misc_model_use_once() 51 | { 52 | self.frame = self.count; 53 | self.think = misc_model_think_once; 54 | self.nextthink = time + 0.1; 55 | } 56 | 57 | /////////////////////////////// 58 | 59 | void misc_model() 60 | { 61 | if(self.model == "") { objerror("misc_model with no model specified"); } 62 | precache_model(self.model); 63 | setmodel(self, self.model); 64 | setorigin(self, self.origin); 65 | self.solid = SOLID_NOT; 66 | 67 | if(self.spawnflags == 0) 68 | { 69 | makestatic(self); 70 | return; 71 | } 72 | 73 | if(self.cnt < self.frame) { objerror("misc_model with invalid frame range (cnt < frame)"); } 74 | if(self.targetname == "") { objerror("misc_model with no targetname"); } 75 | self.count = self.frame; 76 | 77 | if(self.spawnflags & MISC_MODEL_ANIMATED_ONCE) 78 | { 79 | self.use = misc_model_use_once; 80 | } 81 | else if(self.spawnflags & (MISC_MODEL_ANIMATED | MISC_MODEL_ANIMATED_START_OFF)) 82 | { 83 | self.use = misc_model_use_loop; 84 | // Stupid way to do it but just flip the bit flag and pretend we just used it. 85 | self.spawnflags ^= MISC_MODEL_ANIMATED_START_OFF; 86 | misc_model_use_loop(); 87 | } 88 | 89 | } 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /quakec_ctf/itemnames.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | string GetNetName( float item_number ) = { 21 | switch ( item_number ) { 22 | case IT_AXE: 23 | return "Axe"; 24 | case IT_SHOTGUN: 25 | return "Shotgun"; 26 | case IT_SUPER_SHOTGUN: 27 | return "Super Shotgun"; 28 | case IT_NAILGUN: 29 | return "Nailgun"; 30 | case IT_SUPER_NAILGUN: 31 | return "Perforator"; 32 | case IT_GRENADE_LAUNCHER: 33 | return "Grenade Launcher"; 34 | case IT_ROCKET_LAUNCHER: 35 | return "Rocket Launcher"; 36 | case IT_LIGHTNING: 37 | return "Lightning Gun"; 38 | case IT_HOOK: 39 | return "Grappling Hook"; 40 | case IT_SHELLS: 41 | return "Shells"; 42 | case IT_NAILS: 43 | return "Nails"; 44 | case IT_ROCKETS: 45 | return "Rockets"; 46 | case IT_CELLS: 47 | return "Cells"; 48 | case IT_ARMOR1: 49 | return "Green Armor"; 50 | case IT_ARMOR2: 51 | return "Yellow Armor"; 52 | case IT_ARMOR3: 53 | return "Red Armor"; 54 | case IT_SUPERHEALTH: 55 | return "Mega Health"; 56 | case IT_KEY1: { 57 | if ( world.worldtype == WORLDTYPE_MEDIEVAL ) 58 | return "Silver key"; 59 | else if ( world.worldtype == WORLDTYPE_METAL ) 60 | return "Silver runkey"; 61 | else if ( world.worldtype == WORLDTYPE_BASE ) 62 | return "Silver keycard"; 63 | } 64 | case IT_KEY2: { 65 | if ( world.worldtype == WORLDTYPE_MEDIEVAL ) 66 | return "Gold key"; 67 | else if ( world.worldtype == WORLDTYPE_METAL ) 68 | return "Gold runkey"; 69 | else if ( world.worldtype == WORLDTYPE_BASE ) 70 | return "Gold keycard"; 71 | } 72 | case IT_INVISIBILITY: 73 | return "Ring of Shadows"; 74 | case IT_INVULNERABILITY: 75 | return "Pentagram of Protection"; 76 | case IT_SUIT: 77 | return "Biohazard Suit"; 78 | case IT_QUAD: 79 | return "Quad Damage"; 80 | 81 | default: 82 | return string_null; 83 | } 84 | }; -------------------------------------------------------------------------------- /quakec_hipnotic/hipspike.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ============================================================================== 22 | 23 | spike mine 24 | 25 | ============================================================================== 26 | */ 27 | 28 | $cd id1/models/demon3 29 | $scale 0.8 30 | $origin 0 0 24 31 | $base base 32 | $skin base 33 | 34 | $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9 35 | $frame stand10 stand11 stand12 stand13 36 | 37 | $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 38 | 39 | $frame run1 run2 run3 run4 run5 run6 40 | 41 | $frame leap1 leap2 leap3 leap4 leap5 leap6 leap7 leap8 leap9 leap10 42 | $frame leap11 leap12 43 | 44 | $frame pain1 pain2 pain3 pain4 pain5 pain6 45 | 46 | $frame death1 death2 death3 death4 death5 death6 death7 death8 death9 47 | 48 | $frame attacka1 attacka2 attacka3 attacka4 attacka5 attacka6 attacka7 attacka8 49 | $frame attacka9 attacka10 attacka11 attacka12 attacka13 attacka14 attacka15 50 | 51 | void() monster_spikemine = 52 | { 53 | if (deathmatch) 54 | { 55 | remove(self); 56 | return; 57 | } 58 | precache_model ("progs/demon.mdl"); 59 | precache_model ("progs/h_demon.mdl"); 60 | 61 | precache_sound ("demon/ddeath.wav"); 62 | precache_sound ("demon/dhit2.wav"); 63 | precache_sound ("demon/djump.wav"); 64 | precache_sound ("demon/dpain1.wav"); 65 | precache_sound ("demon/idle1.wav"); 66 | precache_sound ("demon/sight2.wav"); 67 | 68 | self.solid = SOLID_SLIDEBOX; 69 | self.movetype = MOVETYPE_STEP; 70 | 71 | setmodel (self, "progs/demon.mdl"); 72 | 73 | setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); 74 | 75 | /* 76 | self.th_stand = gremlin_stand1; 77 | self.th_walk = gremlin_walk1; 78 | self.th_run = gremlin_run1; 79 | self.th_die = gremlin_die; 80 | self.th_melee = Gremlin_MeleeAttack; // one of two attacks 81 | self.th_missile = Gremlin_MissileAttack; // check for random jump or firing of weapon 82 | self.th_pain = gremlin_pain; 83 | walkmonster_start(); 84 | */ 85 | }; 86 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipquake.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Earthquake QuickC program 21 | By Jim Dose' 9/13/96 22 | */ 23 | //JIM 24 | float earthquake; 25 | float quakeactive; 26 | 27 | void() StopEarthQuake = 28 | { 29 | earthquake = 0; 30 | }; 31 | 32 | void( float value ) EarthQuakeTime = 33 | { 34 | value = value + time; 35 | if ( value > earthquake ) 36 | { 37 | earthquake = value; 38 | } 39 | }; 40 | 41 | void() earthquake_prethink = 42 | { 43 | // if ( lastearthquake ) 44 | // { 45 | // self.view_ofs_z = self.savedz; 46 | // lastearthquake = 0; 47 | // } 48 | }; 49 | 50 | void() earthquake_postthink = 51 | { 52 | if ( earthquake > time ) 53 | { 54 | if (quakeactive == 0) 55 | { 56 | sound (self, CHAN_VOICE, "misc/quake.wav", 1, ATTN_NONE); 57 | quakeactive = 1; 58 | } 59 | // lastearthquake = 1; 60 | // self.savedz = self.view_ofs_z; 61 | if ( self.flags & FL_ONGROUND ) 62 | { 63 | // self.view_ofs_z = self.view_ofs_z - 5 + random() * 10; 64 | self.velocity = self.velocity + (random() * '0 0 150'); 65 | } 66 | } 67 | else 68 | { 69 | if (quakeactive == 1) 70 | { 71 | sound (self, CHAN_VOICE, "misc/quakeend.wav", 1, ATTN_NONE); 72 | quakeactive = 0; 73 | } 74 | } 75 | }; 76 | 77 | void() earthquake_use = 78 | { 79 | EarthQuakeTime( self.dmg ); 80 | }; 81 | 82 | /*QUAKED func_earthquake (0 0 0.5) (0 0 0) (32 32 32) 83 | Causes an earthquake. Triggers targets. 84 | 85 | "dmg" is the duration of the earthquake. Default is 0.8 seconds. 86 | */ 87 | 88 | void() func_earthquake = 89 | { 90 | quakeactive = 0; 91 | precache_sound("misc/quake.wav"); 92 | precache_sound("misc/quakeend.wav"); 93 | self.classname = "earthquake"; 94 | self.use = earthquake_use; 95 | self.think = SUB_Null; 96 | if ( !self.dmg ) 97 | { 98 | self.dmg = 0.8; 99 | } 100 | }; 101 | -------------------------------------------------------------------------------- /quakec_hipnotic/amtest.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~> 21 | ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/ 22 | 23 | void() test_teleport_touch; 24 | void() tele_done; 25 | 26 | /*QUAKED test_teleport (0 .5 .8) ? 27 | Teleporter testing 28 | */ 29 | void() test_teleport = 30 | { 31 | precache_model ("sprites/s_aball.spr"); 32 | setsize (self, self.mins, self.maxs); 33 | self.touch = test_teleport_touch; 34 | self.solid = 1; 35 | 36 | if (!self.target) 37 | objerror ("no target\n"); 38 | }; 39 | 40 | void() test_teleport_touch = 41 | { 42 | local entity oldself; 43 | other.movetype = MOVETYPE_TOSS; 44 | // other.solid = SOLID_NOT; 45 | other.dest = '256 -128 -128'; 46 | oldself = self; 47 | self = other; 48 | // SUB_CalcMove (self.dest, 200, tele_done); 49 | self.velocity = '1000 0 0 '; 50 | self = oldself; 51 | }; 52 | 53 | void() tele_done = 54 | { 55 | self.movetype = MOVETYPE_WALK; 56 | self.solid = SOLID_SLIDEBOX; 57 | }; 58 | 59 | /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~> 60 | ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/ 61 | 62 | void() test_goaway; 63 | void() test_spawn; 64 | 65 | /*QUAKED test_fodder (0 .5 .8) ? 66 | beating guy 67 | */ 68 | void() test_fodder = 69 | { 70 | self.nextthink = time + 3; 71 | self.think = test_spawn; 72 | }; 73 | 74 | void() test_spawn = 75 | { 76 | local entity body; 77 | makevectors (self.angles); 78 | 79 | body = spawn(); 80 | setmodel (body, "progs/soldier.mdl"); 81 | setorigin (body, self.origin); 82 | body.classname = "player"; 83 | body.health = 1000; 84 | body.frags = 0; 85 | body.takedamage = DAMAGE_AIM; 86 | body.solid = SOLID_SLIDEBOX; 87 | body.movetype = MOVETYPE_WALK; 88 | body.show_hostile = 0; 89 | body.weapon = 1; 90 | body.velocity = v_forward * 200; 91 | 92 | body.nextthink = time + 5; 93 | body.think = test_goaway; 94 | 95 | self.nextthink = time + 3; 96 | self.think = test_spawn; 97 | 98 | }; 99 | 100 | void() test_goaway = 101 | { 102 | remove (self); 103 | }; 104 | 105 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipclock.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Clock QuickC program 21 | By Jim Dose' 11/25/96 22 | 23 | */ 24 | 25 | void() clock_setpos = 26 | { 27 | local float pos; 28 | local float ang; 29 | local float seconds; 30 | local string temp; 31 | 32 | // How much time has elapsed. 33 | seconds = time + self.cnt; 34 | 35 | // divide by time it takes for one revolution 36 | pos = seconds / self.count; 37 | 38 | // chop off non-fractional component 39 | pos = pos - floor( pos ); 40 | 41 | ang = 360 * pos; 42 | if ( self.event ) 43 | { 44 | if ( self.ltime > ang ) 45 | { 46 | // past twelve 47 | temp = self.target; 48 | self.target = self.event; 49 | SUB_UseTargets(); 50 | self.target = temp; 51 | } 52 | } 53 | 54 | self.angles_x = ang * self.movedir_x; 55 | self.angles_y = ang * self.movedir_y; 56 | self.angles_z = ang * self.movedir_z; 57 | RotateTargetsFinal(); 58 | 59 | self.ltime = ang; 60 | }; 61 | 62 | void() clock_think = 63 | { 64 | clock_setpos(); 65 | self.nextthink = time + 1; 66 | }; 67 | 68 | void() clock_firstthink = 69 | { 70 | LinkRotateTargets(); 71 | self.think = clock_think; 72 | clock_think(); 73 | }; 74 | 75 | /*QUAKED func_clock (0 0 0.5) (0 0 0) (32 32 32) 76 | Creates one hand of a "clock". 77 | 78 | Set the angle to be the direction the clock is facing. 79 | 80 | "event" is the targetname of the entities to trigger when hand strikes 12. 81 | "cnt" is the time to start at. 82 | "count" is the # of seconds it takes to make a full revolution (seconds is 60, minutes 3600, hours 43200). default is 60. 83 | */ 84 | 85 | void() func_clock = 86 | { 87 | local vector temp; 88 | 89 | self.classname = "clock"; 90 | self.think = clock_firstthink; 91 | self.nextthink = time + 0.1; 92 | self.ltime = time; 93 | SetMovedir(); 94 | temp = self.movedir; 95 | self.movedir_x = 0 - temp_y; 96 | self.movedir_y = 0 - temp_z; 97 | self.movedir_z = 0 - temp_x; 98 | 99 | if ( !self.count ) 100 | { 101 | self.count = 60; 102 | } 103 | self.cnt = self.cnt * ( self.count / 12 ); 104 | }; 105 | -------------------------------------------------------------------------------- /quakec_ctf/progdefs.h: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct 5 | { int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | float force_retouch; 12 | string_t mapname; 13 | float deathmatch; 14 | float coop; 15 | float teamplay; 16 | float serverflags; 17 | float total_secrets; 18 | float total_monsters; 19 | float found_secrets; 20 | float killed_monsters; 21 | float parm1; 22 | float parm2; 23 | float parm3; 24 | float parm4; 25 | float parm5; 26 | float parm6; 27 | float parm7; 28 | float parm8; 29 | float parm9; 30 | float parm10; 31 | float parm11; 32 | float parm12; 33 | float parm13; 34 | float parm14; 35 | float parm15; 36 | float parm16; 37 | vec3_t v_forward; 38 | vec3_t v_up; 39 | vec3_t v_right; 40 | float trace_allsolid; 41 | float trace_startsolid; 42 | float trace_fraction; 43 | vec3_t trace_endpos; 44 | vec3_t trace_plane_normal; 45 | float trace_plane_dist; 46 | int trace_ent; 47 | float trace_inopen; 48 | float trace_inwater; 49 | int msg_entity; 50 | func_t main; 51 | func_t StartFrame; 52 | func_t PlayerPreThink; 53 | func_t PlayerPostThink; 54 | func_t ClientKill; 55 | func_t ClientConnect; 56 | func_t PutClientInServer; 57 | func_t ClientDisconnect; 58 | func_t SetNewParms; 59 | func_t SetChangeParms; 60 | } globalvars_t; 61 | 62 | typedef struct 63 | { 64 | float modelindex; 65 | vec3_t absmin; 66 | vec3_t absmax; 67 | float ltime; 68 | float movetype; 69 | float solid; 70 | vec3_t origin; 71 | vec3_t oldorigin; 72 | vec3_t velocity; 73 | vec3_t angles; 74 | vec3_t avelocity; 75 | vec3_t punchangle; 76 | string_t classname; 77 | string_t model; 78 | float frame; 79 | float skin; 80 | float effects; 81 | vec3_t mins; 82 | vec3_t maxs; 83 | vec3_t size; 84 | func_t touch; 85 | func_t use; 86 | func_t think; 87 | func_t blocked; 88 | float nextthink; 89 | int groundentity; 90 | float health; 91 | float frags; 92 | float weapon; 93 | string_t weaponmodel; 94 | float weaponframe; 95 | float currentammo; 96 | float ammo_shells; 97 | float ammo_nails; 98 | float ammo_rockets; 99 | float ammo_cells; 100 | float items; 101 | float takedamage; 102 | int chain; 103 | float deadflag; 104 | vec3_t view_ofs; 105 | float button0; 106 | float button1; 107 | float button2; 108 | float impulse; 109 | float fixangle; 110 | vec3_t v_angle; 111 | float idealpitch; 112 | string_t netname; 113 | int enemy; 114 | float flags; 115 | float colormap; 116 | float team; 117 | float max_health; 118 | float teleport_time; 119 | float armortype; 120 | float armorvalue; 121 | float waterlevel; 122 | float watertype; 123 | float ideal_yaw; 124 | float yaw_speed; 125 | int aiment; 126 | int goalentity; 127 | float spawnflags; 128 | string_t target; 129 | string_t targetname; 130 | float dmg_take; 131 | float dmg_save; 132 | int dmg_inflictor; 133 | int owner; 134 | vec3_t movedir; 135 | string_t message; 136 | float sounds; 137 | string_t noise; 138 | string_t noise1; 139 | string_t noise2; 140 | string_t noise3; 141 | } entvars_t; 142 | 143 | #define PROGHEADER_CRC 5927 144 | -------------------------------------------------------------------------------- /quakec_hipnotic/hip_brk.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Breakaway walls QuickC program 21 | By Jim Dose' 9/11/96 22 | 23 | */ 24 | 25 | float MULTI_USE = 1; 26 | float INVISIBLE = 2; 27 | 28 | void() damagethreshold_killed = 29 | { 30 | self.health = self.max_health; 31 | 32 | // self.solid = SOLID_NOT; 33 | activator = damage_attacker; 34 | self.takedamage = DAMAGE_NO; 35 | SUB_UseTargets (); 36 | self.takedamage = DAMAGE_YES; 37 | 38 | if ( !( self.spawnflags & MULTI_USE ) ) 39 | { 40 | remove( self ); 41 | } 42 | }; 43 | 44 | void() damagethreshold_pain = 45 | { 46 | self.health = self.max_health; 47 | }; 48 | 49 | /*QUAKED trigger_damagethreshold (0 .5 .8) ? MULTI_USE INVISIBLE 50 | Triggers only when a threshold of damage is exceeded. 51 | When used in conjunction with func_breakawaywall, allows 52 | walls that may be destroyed with a rocket blast. 53 | 54 | MULTI_USE tells the trigger to not to remove itself after 55 | being fired. Allows the trigger to be used multiple times. 56 | 57 | INVISIBLE tells the trigger to not be visible. 58 | 59 | "health" specifies how much damage must occur before trigger fires. 60 | Default is 60. 61 | 62 | */ 63 | 64 | void() trigger_damagethreshold = 65 | 66 | { 67 | self.mangle = self.angles; 68 | self.angles = '0 0 0'; 69 | 70 | self.classname = "damagethreshold"; 71 | self.solid = SOLID_BSP; 72 | self.movetype = MOVETYPE_PUSH; 73 | setorigin (self, self.origin); 74 | setmodel (self, self.model); 75 | setsize (self, self.mins , self.maxs); 76 | if ( self.spawnflags & INVISIBLE ) 77 | { 78 | self.model = string_null; 79 | } 80 | 81 | if (!self.health) 82 | { 83 | self.health = 60; 84 | } 85 | self.max_health = self.health; 86 | self.takedamage = DAMAGE_YES; 87 | 88 | self.blocked = SUB_Null; 89 | self.th_pain = damagethreshold_pain; 90 | self.th_die = damagethreshold_killed; 91 | }; 92 | 93 | /*QUAKED func_breakawaywall (0 .5 .8) ? 94 | Special walltype that removes itself when triggered. 95 | */ 96 | 97 | void() func_breakawaywall = 98 | { 99 | self.mangle = self.angles; 100 | self.angles = '0 0 0'; 101 | 102 | self.classname = "breakaway"; 103 | self.solid = SOLID_BSP; 104 | self.movetype = MOVETYPE_PUSH; 105 | setorigin (self, self.origin); 106 | setmodel (self, self.model); 107 | setsize (self, self.mins , self.maxs); 108 | self.use = SUB_Remove; 109 | }; 110 | -------------------------------------------------------------------------------- /quakec_mg1/map_specific/mge2m2.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | //Electrodes 22 | 23 | void mge2m2_electrode_target() 24 | { 25 | } 26 | 27 | // Electrode buttons 28 | 29 | float mge2m2_match_cnt(entity e) { return self.cnt == e.cnt; } 30 | 31 | void mge2m2_electrode_button_touch() 32 | { 33 | if(other.classname != "player") return; 34 | if(other.health <= 0) return; 35 | 36 | button_touch(); 37 | self.touch = SUB_Null; 38 | 39 | entity t = SUB_FindWithPredicate(world, classname, "mge2m2_electrode_target", mge2m2_match_cnt); 40 | while(t) 41 | { 42 | t.think = SUB_Remove; 43 | t.nextthink = time + 0.1; 44 | t = SUB_FindWithPredicate(t, classname, "mge2m2_electrode_target", mge2m2_match_cnt); 45 | } 46 | } 47 | 48 | void mge2m2_electrode_button() 49 | { 50 | func_button(); 51 | self.touch = mge2m2_electrode_button_touch; 52 | } 53 | 54 | // Opening the rune "egg" 55 | 56 | void mge2m2_rune_egg_opener_use() 57 | { 58 | entity t, oself; 59 | oself = self; 60 | t = find(world, targetname, self.target); 61 | while(t) 62 | { 63 | if(t.classname == "func_door") 64 | { 65 | self = t; 66 | self.movedir = self.dest2; 67 | self.pos1 = self.origin; 68 | self.pos2 = self.pos1 + self.movedir; 69 | self.state = STATE_BOTTOM; 70 | self.speed = 500; 71 | self.noise1 = "doors/drclos4.wav"; 72 | self.noise2 = "doors/doormv1.wav"; 73 | door_go_up(); 74 | } 75 | t = find(t, targetname, oself.target); 76 | } 77 | self = oself; 78 | } 79 | 80 | void mge2m2_rune_egg_opener() 81 | { 82 | self.use = mge2m2_rune_egg_opener_use; 83 | } 84 | 85 | // Rune pickupability 86 | 87 | void mge2m2_rune_pickup_fixer_use() 88 | { 89 | void() tutsh; 90 | if(self.state) tutsh = sigil_touch; 91 | else 92 | { 93 | self.state = 1; 94 | tutsh = SUB_Null; 95 | } 96 | entity ru = find(world, classname, "item_sigil"); 97 | while(ru) 98 | { 99 | ru.touch = tutsh; 100 | ru = find(ru, classname, "item_sigil"); 101 | } 102 | } 103 | 104 | void mge2m2_rune_pickup_fixer() 105 | { 106 | self.use = mge2m2_rune_pickup_fixer_use; 107 | self.think = mge2m2_rune_pickup_fixer_use; 108 | self.nextthink = time + 0.8; 109 | } 110 | 111 | // Obsolete, replace with trigger_cleanup_corpses 112 | void mge2m2_cleanup_corpses() { dprint("WARNING: entity 'mge2m2_cleanup_corpses' spawned. Please replace with 'trigger_cleanup_corpses'.\n"); trigger_cleanup_corpses();} -------------------------------------------------------------------------------- /quakec_rogue/shield.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // Shield 21 | // 22 | 23 | // =================== 24 | // shield_think 25 | // =================== 26 | void() shield_think = 27 | { 28 | if ( self.owner.shield_death_time < time) 29 | { 30 | self.owner.shield_entity = world; 31 | remove (self); 32 | return; 33 | } 34 | 35 | if ( (self.owner.shield_death_time - 0.25) <= time) 36 | { 37 | self.model = string_null; 38 | } 39 | else 40 | { 41 | setorigin ( self, self.owner.origin ); 42 | self.v_angle = self.owner.v_angle; 43 | self.angles = self.owner.angles; 44 | } 45 | 46 | self.think = shield_think; 47 | self.nextthink = time + 0.05; 48 | }; 49 | 50 | // =================== 51 | // shield_spawn 52 | // =================== 53 | void(entity shieldOwner, vector dir) shield_spawn = 54 | { 55 | local entity newShield; 56 | 57 | if ( shieldOwner.shield_death_time > time) 58 | { 59 | return; 60 | } 61 | 62 | newShield = spawn (); 63 | newShield.owner = shieldOwner; 64 | newShield.solid = SOLID_NOT; 65 | newShield.takedamage = DAMAGE_NO; 66 | newShield.movetype = MOVETYPE_NONE; 67 | newShield.classname = "power_shield"; 68 | 69 | // time for shield to live 70 | // shieldOwner.shield_death_time = time + 0.5; 71 | shieldOwner.shield_death_time = time + 0.3; 72 | shieldOwner.shield_entity = newShield; 73 | 74 | newShield.v_angle = shieldOwner.v_angle; 75 | newShield.angles = shieldOwner.angles; 76 | setorigin (newShield, shieldOwner.origin); 77 | setmodel (newShield, "progs/p_shield.mdl"); 78 | setsize (newShield, '0 0 0', '0 0 0'); 79 | 80 | newShield.nextthink = time + 0.1; 81 | newShield.think = shield_think; 82 | }; 83 | 84 | 85 | // =================== 86 | // shield_hit 87 | // =================== 88 | float(entity targ, entity inflictor, entity attacker, float damage) shield_hit= 89 | { 90 | local vector dir; 91 | local float save; 92 | local float hitAngle; 93 | 94 | dir = inflictor.origin - targ.origin; 95 | save = vectoyaw ( dir ); 96 | makevectors (targ.angles); 97 | hitAngle = save - vectoyaw ( v_forward ); 98 | 99 | if(hitAngle > 90 && hitAngle < 270) 100 | { 101 | return damage; 102 | } 103 | else if(hitAngle < -90 && hitAngle > -270 ) 104 | { 105 | return damage; 106 | } 107 | 108 | shield_spawn ( targ, dir); 109 | 110 | if (targ.shieldSoundTime < time) 111 | { 112 | sound (targ, CHAN_ITEM, "shield/hit.wav", 1, ATTN_NORM); 113 | targ.shieldSoundTime = time + 0.5; 114 | } 115 | 116 | if (inflictor.classname == "lava_spike") 117 | save = damage * 0.70; 118 | else 119 | save = damage * 0.30; 120 | 121 | return save; 122 | }; 123 | -------------------------------------------------------------------------------- /quakec_hipnotic/hip_push.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Pushable walls QuickC program 21 | By Jim Dose' 9/16/96 22 | 23 | */ 24 | 25 | void() push_use = 26 | { 27 | local vector delta; 28 | local float x; 29 | local float y; 30 | 31 | // walkmove (other.angles_y, 16 * frametime); 32 | /* 33 | if ( (other.angles_y >= 315) || (other.angles_y < 45)) 34 | { 35 | walkmove ( 0, 16 * frametime); 36 | } 37 | else if ( (other.angles_y >= 45) && (other.angles_y < 135)) 38 | { 39 | walkmove ( 90, 16 * frametime); 40 | } 41 | else if ( (other.angles_y >= 135) && (other.angles_y < 225)) 42 | { 43 | walkmove ( 180, 16 * frametime); 44 | } 45 | else if ( (other.angles_y >= 225) && (other.angles_y < 315)) 46 | { 47 | walkmove ( 270, 16 * frametime); 48 | } 49 | else 50 | { 51 | return; 52 | } 53 | */ 54 | makevectors(other.angles); 55 | 56 | // x = fabs( v_forward_x ); 57 | // y = fabs( v_forward_y ); 58 | x = fabs( other.velocity_x ); 59 | y = fabs( other.velocity_y ); 60 | dprint( ftos( x ) ); 61 | dprint( ", " ); 62 | dprint( ftos( y ) ); 63 | if ( x > y ) 64 | { 65 | dprint( " x move\n\n\n\n" ); 66 | if ( other.velocity_x > 0 ) 67 | { 68 | walkmove ( 0, 16 * frametime); 69 | } 70 | else 71 | { 72 | walkmove( 180, 16 * frametime ); 73 | } 74 | } 75 | else 76 | { 77 | dprint( " y move\n\n\n\n" ); 78 | if ( other.velocity_y > 0 ) 79 | { 80 | walkmove ( 90, 16 * frametime); 81 | } 82 | else 83 | { 84 | walkmove( 270, 16 * frametime ); 85 | } 86 | } 87 | 88 | delta = self.origin - self.oldorigin; 89 | setorigin (self.owner, self.owner.oldorigin + delta ); 90 | }; 91 | 92 | /*QUAKED func_pushable (0 .5 .8) ? 93 | Pushable walls. 94 | */ 95 | 96 | void() func_pushable = 97 | { 98 | local entity new; 99 | local vector newsize; 100 | 101 | self.mangle = self.angles; 102 | self.angles = '0 0 0'; 103 | 104 | self.classname = "pushablewall"; 105 | self.solid = SOLID_BSP; 106 | self.movetype = MOVETYPE_PUSH; 107 | setmodel (self, self.model); 108 | setorigin( self, self.origin ); 109 | setsize (self, self.mins, self.maxs ); 110 | self.oldorigin = self.origin; 111 | 112 | new = spawn(); 113 | new.owner = self; 114 | new.mangle = self.mangle; 115 | new.angles = self.angles; 116 | 117 | new.classname = "pushablewallproxy"; 118 | new.solid = SOLID_BBOX; 119 | new.movetype = MOVETYPE_STEP; 120 | new.origin = ( self.mins + self.maxs ) * 0.5 + '0 0 1'; 121 | newsize = ( self.maxs - self.mins ) * 0.5; 122 | new.mins = '-1 -1 0' - newsize; 123 | new.maxs = '1 1 -2' + newsize; 124 | setsize( new, new.mins, new.maxs ); 125 | setorigin( new, new.origin ); 126 | new.oldorigin = new.origin; 127 | new.touch = push_use; 128 | }; 129 | -------------------------------------------------------------------------------- /quakec_ctf/status.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | .float laststattime; // time of last status update 21 | .float statstate; // is the status bar on? 22 | 23 | float PLAYERSTATTIME = 1.75; 24 | 25 | void() MOTD = 26 | { 27 | SendCTFScoresUpdate(self); 28 | 29 | if (gamestart) { 30 | centerprint(self, "$qc_choose_exit"); 31 | return; 32 | } 33 | 34 | if (self.team == TEAM_COLOR1) 35 | centerprint(self, "$qc_ctf_red"); //red 36 | else 37 | centerprint(self, "$qc_ctf_blue"); //blue 38 | 39 | return; 40 | }; 41 | 42 | void() MOTD_ChooseTeam = 43 | { 44 | SendCTFScoresUpdate(self); 45 | if (PromptSupported()) { 46 | prompt(self, "$qc_ctf_intro", 4); 47 | promptchoice(self, "$qc_ctf_intro_auto", 103); 48 | promptchoice(self, "$qc_ctf_intro_red", 101); 49 | promptchoice(self, "$qc_ctf_intro_blue", 102); 50 | promptchoice(self, "$qc_ctf_intro_observer", 104); 51 | } else { 52 | centerprint(self, "Welcome!\nRunning ThreeWave CTF 5.0\n\nCapture the Flag!\n\nPress 1 for RED team\nPress 2 for BLUE team\nOr press JUMP for automatic team\n"); 53 | } 54 | }; 55 | 56 | void() TeamEndScore = 57 | { 58 | local string s; 59 | 60 | if (gamestart) 61 | return; 62 | 63 | if (teamscr1 > teamscr2) { 64 | s = ftos(teamscr1); 65 | bprint("$qc_ks_red_won", s); 66 | s = ftos(teamscr2); 67 | bprint("$qc_ks_blue_lost", s); 68 | } else if (teamscr1 < teamscr2) { 69 | s = ftos(teamscr2); 70 | bprint("$qc_ks_blue_won", s); 71 | s = ftos(teamscr1); 72 | bprint("$qc_ks_red_lost", s); 73 | } else { 74 | s = ftos(teamscr1); 75 | bprint("$qc_ks_match_tied", s); 76 | } 77 | }; 78 | 79 | void(entity e) SendCTFScoresUpdate = 80 | { 81 | local float flagstatus = 0; 82 | local entity flag; 83 | 84 | flag = find(world, classname, "item_flag_team1"); 85 | if (flag.cnt == FLAG_AT_BASE) 86 | flagstatus |= 1; 87 | else if (flag.cnt == FLAG_CARRIED) 88 | flagstatus |= 2; 89 | else if (flag.cnt == FLAG_DROPPED) 90 | flagstatus |= 4; 91 | 92 | flag = find(world, classname, "item_flag_team2"); 93 | if (flag.cnt == FLAG_AT_BASE) 94 | flagstatus |= 8; 95 | else if (flag.cnt == FLAG_CARRIED) 96 | flagstatus |= 16; 97 | else if (flag.cnt == FLAG_DROPPED) 98 | flagstatus |= 32; 99 | 100 | stuffcmd(e, "ctfscores "); 101 | stuffcmd(e, ftos(teamscr1)); 102 | stuffcmd(e, " "); 103 | stuffcmd(e, ftos(teamscr2)); 104 | stuffcmd(e, " "); 105 | stuffcmd(e, ftos(flagstatus)); 106 | stuffcmd(e, "\n"); 107 | }; 108 | 109 | void() SendCTFScoresUpdateAll = 110 | { 111 | local entity e = find(world, classname, "player"); 112 | while(e) 113 | { 114 | SendCTFScoresUpdate(e); 115 | e = find(e, classname, "player"); 116 | } 117 | } -------------------------------------------------------------------------------- /quakec_rogue/motd.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // Rogue Teamplay Variants Message of the Day function 21 | // Feb'97 by ZOID 22 | // Under contract to id software for Rogue Entertainment 23 | 24 | .float motd_time; 25 | .float motd_count; 26 | 27 | void() MOTD = 28 | { 29 | local string tp; 30 | 31 | if (self.motd_count < 5) { 32 | if (teamplay > 3 && teamplay < 7) 33 | { 34 | tp = ftos(teamplay); 35 | stuffcmd(self, "teamplay "); 36 | stuffcmd(self, tp); 37 | stuffcmd(self, "\n"); 38 | } 39 | self.motd_time = time + 1; 40 | self.motd_count = self.motd_count + 1; 41 | /* 42 | if (teamplay == TEAM_NORMAL_NODAMAGE) 43 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nTeam play: No Friendly Fire\n"); 44 | else if (teamplay == TEAM_NORMAL_DAMAGE) 45 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nTeam play: Friendly Fire\n"); 46 | */ 47 | if (teamplay == TEAM_DMATCH_TAG) 48 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nDeathmatch Tag!\n"); 49 | else if (teamplay == TEAM_CTF) 50 | if (self.steam == TEAM1) 51 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n\nYou are ��� team!\n"); 52 | else 53 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n\nYou are ���� team!\n"); 54 | else if (teamplay == TEAM_CTF_ONEFLAG) 55 | if (self.steam == TEAM1) 56 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(One Flag Mode)\n\nYou are ��� team!\n"); 57 | else 58 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(One Flag Mode)\n\nYou are ���� team!\n"); 59 | else if (teamplay == TEAM_CTF_ALT) 60 | if (self.steam == TEAM1) 61 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ��� team!\n"); 62 | else if (self.steam == TEAM2) 63 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ���� team!\n"); 64 | else 65 | centerprint(self, "Welcome to\nThe Dissolution of Eternity!\nBy Rogue Entertainment\n\nCAPTURE THE FLAG!\n(Three Team Mode)\n\nYou are ���� team!\n"); 66 | return; 67 | } 68 | self.motd_time = 0; 69 | }; 70 | 71 | void() CheckMOTD = 72 | { 73 | // if (self.motd_time && self.motd_time < time) 74 | if (self.motd_time) 75 | { 76 | if(self.motd_time < time) 77 | MOTD(); 78 | } 79 | }; 80 | 81 | void() SetMOTD = 82 | { 83 | self.motd_time = time + 3; 84 | if ( teamplay == 3 ) 85 | self.motd_count = 2; 86 | else 87 | self.motd_count = 0; 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /quakec_ctf/server.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | void() monster_ogre = {remove(self);}; 21 | void() monster_demon1 = {remove(self);}; 22 | void() monster_shambler = {remove(self);}; 23 | void() monster_knight = {remove(self);}; 24 | void() monster_army = {remove(self);}; 25 | void() monster_wizard = {remove(self);}; 26 | void() monster_dog = {remove(self);}; 27 | void() monster_zombie = {remove(self);}; 28 | void() monster_boss = {remove(self);}; 29 | void() monster_tarbaby = {remove(self);}; 30 | void() monster_hell_knight = {remove(self);}; 31 | void() monster_fish = {remove(self);}; 32 | void() monster_shalrath = {remove(self);}; 33 | void() monster_enforcer = {remove(self);}; 34 | void() monster_oldone = {remove(self);}; 35 | 36 | /* 37 | ============================================================================== 38 | 39 | MOVETARGET CODE 40 | 41 | The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target. 42 | 43 | targetname 44 | must be present. The name of this movetarget. 45 | 46 | target 47 | the next spot to move to. If not present, stop here for good. 48 | 49 | pausetime 50 | The number of seconds to spend standing or bowing for path_stand or path_bow 51 | 52 | ============================================================================== 53 | */ 54 | 55 | /* 56 | ============= 57 | t_movetarget 58 | 59 | Something has bumped into a movetarget. If it is a monster 60 | moving towards it, change the next destination and continue. 61 | ============== 62 | */ 63 | void() t_movetarget = 64 | { 65 | local entity temp; 66 | 67 | if (other.movetarget != self) 68 | return; 69 | 70 | if (other.enemy) 71 | return; // fighting, not following a path 72 | 73 | temp = self; 74 | self = other; 75 | other = temp; 76 | 77 | if (self.classname == "monster_ogre") 78 | sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound 79 | 80 | //dprint ("t_movetarget\n"); 81 | self.goalentity = self.movetarget = find (world, targetname, other.target); 82 | self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); 83 | if (!self.movetarget) 84 | { 85 | self.pausetime = time + 999999; 86 | self.th_stand (); 87 | return; 88 | } 89 | }; 90 | 91 | 92 | 93 | void() movetarget_f = 94 | { 95 | if (!self.targetname) 96 | objerror ("monster_movetarget: no targetname"); 97 | 98 | self.solid = SOLID_TRIGGER; 99 | self.touch = t_movetarget; 100 | setsize (self, '-8 -8 -8', '8 8 8'); 101 | 102 | }; 103 | 104 | /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) 105 | Monsters will continue walking towards the next target corner. 106 | */ 107 | void() path_corner = 108 | { 109 | movetarget_f (); 110 | }; 111 | 112 | 113 | 114 | //============================================================================ 115 | -------------------------------------------------------------------------------- /quakec_mg1/func_fade.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | const float FUNC_FADE_STATE_HIDDEN = 0; 22 | const float FUNC_FADE_STATE_VISIBLE = 1; 23 | 24 | const float FUNC_FADE_DISTANCE_MAXSPEED = 320; 25 | 26 | float func_fade_get_shortest_playerdistance() 27 | { 28 | float dist = 32767; 29 | float d; 30 | 31 | vector vpos; 32 | 33 | entity pl = find (world, classname, "player"); 34 | while (pl != world) 35 | { 36 | vpos = pl.origin + pl.view_ofs; 37 | d = vlen(self.oldorigin - vpos); 38 | if(d < dist) dist = d; 39 | pl = find (pl, classname, "player"); 40 | } 41 | return dist; 42 | } 43 | 44 | void func_fade_set_nextthink_for_distance(float dist) 45 | { 46 | self.nextthink = self.ltime + Clamp(dist / FUNC_FADE_DISTANCE_MAXSPEED, 0.05, 2.0); 47 | } 48 | 49 | void func_fade_set_alpha(float a, float force=FALSE) 50 | { 51 | a = Clamp(a, 0, 1); 52 | if( !force && fabs(a - self.alpha) < 0.001) return; 53 | if (self.state == FUNC_FADE_STATE_HIDDEN && a > 0) 54 | { 55 | self.state = FUNC_FADE_STATE_VISIBLE; 56 | self.model = self.mdl; 57 | } 58 | else if (self.state == FUNC_FADE_STATE_VISIBLE && a == 0) 59 | { 60 | self.state = FUNC_FADE_STATE_HIDDEN; 61 | self.model = string_null; 62 | } 63 | self.alpha = a; 64 | } 65 | 66 | void func_fade_think() 67 | { 68 | float dist = func_fade_get_shortest_playerdistance(); 69 | float diff = dist - self.distance; 70 | 71 | if (diff < 0) 72 | { 73 | //Outside the transition zone, inside the circle 74 | func_fade_set_alpha(1); 75 | dist = -diff; 76 | func_fade_set_nextthink_for_distance(dist); 77 | } 78 | else if(diff > self.lip) 79 | { 80 | //Outside the transition zone, outside the circle 81 | func_fade_set_alpha(0); 82 | dist = diff - self.lip; 83 | func_fade_set_nextthink_for_distance(dist); 84 | } 85 | else 86 | { 87 | //In the transition zone 88 | diff/= self.lip; 89 | func_fade_set_alpha(1 - diff); 90 | self.nextthink = self.ltime + 0.05; 91 | } 92 | } 93 | 94 | void func_fade() 95 | { 96 | if(TRUE) 97 | { 98 | dprint("WARNING: A func_fade was spawned. This entity is obsolete, and was converted to a func_wall instead.\n") 99 | func_wall(); 100 | return; 101 | } 102 | 103 | if(!self.distance) self.distance = 2048; //Radius of fade circle 104 | if(!self.lip) self.lip = 256; // Lip around fade circle 105 | 106 | self.waitmax = self.distance + self.lip; 107 | 108 | self.solid = SOLID_BSP; 109 | self.movetype = MOVETYPE_PUSH; 110 | 111 | setmodel(self, self.model); 112 | self.mdl = self.model; 113 | self.oldorigin = self.mins + ((self.maxs - self.mins) * 0.5); 114 | 115 | self.state = FUNC_FADE_STATE_VISIBLE; 116 | 117 | self.think = func_fade_think; 118 | self.nextthink = self.ltime + 0.2 + random() * 0.2; 119 | 120 | func_fade_set_alpha(0, TRUE); 121 | } 122 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipholes.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Bullet holes QuickC program 21 | By Jim Dose' 11/20/96 22 | */ 23 | 24 | /*QUAKED wallsprite (0 1 0) (-8 -8 -8) (8 8 8) 25 | Places a sprite on a wall. Angles should be opposite of face. 26 | 27 | "model" sprite to place on wall. Default is "progs/s_blood1.spr". 28 | */ 29 | void() wallsprite = 30 | { 31 | if ( !self.model ) 32 | { 33 | self.model = "progs/s_blood1.spr"; 34 | } 35 | 36 | precache_model( self.model ); 37 | setmodel (self, self.model ); 38 | 39 | // QuakeEd doesn't save up and down angles properly. 40 | if (self.angles == '0 -1 0') 41 | self.angles = '-90 0 0'; 42 | else if (self.angles == '0 -2 0') 43 | self.angles = '90 0 0'; 44 | 45 | // Pull the sprite away from the wall slightly to 46 | // get rid of z sort errors. 47 | makevectors(self.angles); 48 | setorigin( self, self.origin - ( v_forward * 0.2 ) ); 49 | makestatic (self); 50 | }; 51 | 52 | void() InitBulletHoles = 53 | { 54 | precache_model ("progs/s_bullet.spr"); 55 | 56 | bulletholes = nullentity; 57 | lastbullet = nullentity; 58 | numbulletholes = 0; 59 | }; 60 | 61 | void() remove_bullethole = 62 | { 63 | local entity ent; 64 | 65 | // There is a possibility that this is not the first bullet 66 | // in the list, but it doesn't really matter. All that 67 | // matters is there is one less bullet. Just make sure 68 | // we don't remove the world! 69 | if ( bulletholes == nullentity ) 70 | { 71 | objerror("remove_bullethole: bulletholes == nullentity! " ); 72 | } 73 | 74 | ent = bulletholes; 75 | if ( ent.classname != "bullethole" ) 76 | { 77 | objerror("remove_bullethole: Tried to remove non-bullethole!" ); 78 | } 79 | 80 | bulletholes = bulletholes.lastvictim; 81 | remove( ent ); 82 | if ( lastbullet == ent ) 83 | { 84 | lastbullet = nullentity; 85 | } 86 | numbulletholes = numbulletholes - 1; 87 | }; 88 | 89 | void( vector pos ) placebullethole = 90 | { 91 | local entity new; 92 | local entity ent; 93 | local vector norm; 94 | 95 | new = spawn(); 96 | new.owner = new; 97 | new.movetype = MOVETYPE_NONE; 98 | new.solid = SOLID_NOT; 99 | new.classname = "bullethole"; 100 | setmodel( new, "progs/s_bullet.spr" ); 101 | setsize (new, '0 0 0', '0 0 0'); 102 | 103 | norm = trace_plane_normal; 104 | norm_x = 0 - norm_x; 105 | norm_y = 0 - norm_y; 106 | new.angles = vectoangles( norm ); 107 | makevectors(self.angles); 108 | setorigin( new, pos - ( v_forward * 0.2 ) ); 109 | 110 | new.think = remove_bullethole; 111 | new.nextthink = time + 300; 112 | 113 | numbulletholes = numbulletholes + 1; 114 | if ( numbulletholes > 10 ) 115 | { 116 | remove_bullethole(); 117 | } 118 | 119 | if ( lastbullet != nullentity ) 120 | { 121 | lastbullet.lastvictim = new; 122 | } 123 | else 124 | { 125 | bulletholes = new; 126 | } 127 | new.lastvictim = nullentity; 128 | lastbullet = new; 129 | }; 130 | -------------------------------------------------------------------------------- /quakec_mg1/func_bob.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | const float FUNC_BOB_NONSOLID = 1; 21 | const float FUNC_BOB_START_ON = 2; 22 | 23 | const float FUNC_BOB_THINKINTERVAL = 0.05; 24 | 25 | vector func_bob_GetPositionForAngle(float an) 26 | { 27 | self.count += (an); 28 | self.count = mod(self.count, 360); 29 | 30 | float dd = sin(self.count); 31 | vector offs = self.dest * dd; 32 | if(self.dest2) 33 | { 34 | float ddc = cos(self.count); 35 | offs+= (self.dest2 * ddc); 36 | } 37 | 38 | return offs; 39 | } 40 | 41 | void func_bob_blocked() 42 | { 43 | if(self.attack_finished > time) return; 44 | T_Damage(other, self, self, self.dmg); 45 | self.attack_finished = time + 0.5; 46 | } 47 | 48 | /* 49 | We have two different strategies for movement here. 50 | For solid bobbers, we use the think function and set a velocity. This allows us to stand smoothly on the bobber and be blocked by it. 51 | For non solid bobbers, the engine does not like having something nonsolid that moves apparently, so instead we just set its position each frame. 52 | */ 53 | 54 | // Used by non-solid bobbers 55 | void func_bob_tick(float dt) 56 | { 57 | vector offs = func_bob_GetPositionForAngle(self.avelocity_x * dt); 58 | setorigin(self, offs); 59 | } 60 | 61 | // Used by solid bobbers 62 | void func_bob_think() 63 | { 64 | vector offs = func_bob_GetPositionForAngle(self.avelocity_x * FUNC_BOB_THINKINTERVAL); 65 | 66 | vector diff = offs - self.origin; 67 | self.velocity = diff * (1/FUNC_BOB_THINKINTERVAL); 68 | 69 | self.nextthink = self.ltime + FUNC_BOB_THINKINTERVAL; 70 | } 71 | 72 | void func_bob_use() 73 | { 74 | if(self.state) 75 | { 76 | if(self.solid) 77 | { 78 | self.velocity = '0 0 0'; 79 | self.nextthink = -1; 80 | } 81 | else 82 | { 83 | RemoveFrameTickEntity(self); 84 | } 85 | } 86 | else 87 | { 88 | if(self.solid) 89 | { 90 | func_bob_think(); 91 | } 92 | else 93 | { 94 | RegisterFrameTickEntity(self); 95 | } 96 | } 97 | 98 | self.state = 1 - self.state; 99 | } 100 | 101 | void func_bob() 102 | { 103 | setmodel(self, self.model); 104 | setorigin(self, self.origin); 105 | 106 | if(!self.dest) self.dest = '0 0 64'; 107 | if(!self.wait) self.wait = 10; 108 | if(!self.dmg) self.dmg = 1; 109 | 110 | self.avelocity_x = 360 / self.wait; 111 | self.count = 360 * self.delay; 112 | 113 | self.use = func_bob_use; 114 | self.tick = func_bob_tick; 115 | self.think = func_bob_think; 116 | self.blocked = func_bob_blocked; 117 | 118 | 119 | if(self.spawnflags & FUNC_BOB_NONSOLID) 120 | { 121 | self.movetype = MOVETYPE_NONE; 122 | self.solid = SOLID_NOT; 123 | } 124 | else 125 | { 126 | self.movetype = MOVETYPE_PUSH; 127 | self.solid = SOLID_BSP; 128 | } 129 | 130 | if(self.spawnflags & FUNC_BOB_START_ON) 131 | { 132 | func_bob_use(); 133 | } 134 | } -------------------------------------------------------------------------------- /quakec_mg1/misc_corpses.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | //============================================================================ 22 | 23 | typedef struct 24 | { 25 | string mdl; 26 | float frame; 27 | }poseInfo; 28 | 29 | #pragma warning disable F317 //Use of stale framemacros 30 | poseInfo poses[] = 31 | { 32 | { "progs/demon.mdl", $CORPSEFRAME_DEMON_1 }, 33 | { "progs/dog.mdl", $CORPSEFRAME_DOG_1 }, 34 | { "progs/dog.mdl", $CORPSEFRAME_DOG_2 }, 35 | { "progs/enforcer.mdl", $CORPSEFRAME_ENFORCER_1 }, 36 | { "progs/enforcer.mdl", $CORPSEFRAME_ENFORCER_2 }, 37 | { "progs/fish.mdl", $CORPSEFRAME_FISH_1 }, 38 | { "progs/hknight.mdl", $CORPSEFRAME_HKNIGHT_1 }, 39 | { "progs/hknight.mdl", $CORPSEFRAME_HKNIGHT_2 }, 40 | { "progs/knight.mdl", $CORPSEFRAME_KNIGHT_1 }, 41 | { "progs/knight.mdl", $CORPSEFRAME_KNIGHT_2 }, 42 | { "progs/ogre.mdl", $CORPSEFRAME_OGRE_1 }, 43 | { "progs/ogre.mdl", $CORPSEFRAME_OGRE_2 }, 44 | { "progs/shalrath.mdl", $CORPSEFRAME_SHALRATH_1 }, 45 | { "progs/shambler.mdl", $CORPSEFRAME_SHAMBLER_1 }, 46 | { "progs/soldier.mdl", $CORPSEFRAME_SOLDIER_1 }, 47 | { "progs/soldier.mdl", $CORPSEFRAME_SOLDIER_2 }, 48 | { "progs/wizard.mdl", $CORPSEFRAME_WIZARD_1 }, 49 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_1 }, 50 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_2 }, 51 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_3 }, 52 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_4 }, 53 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_5 }, 54 | { "progs/player.mdl", $CORPSEFRAME_PLAYER_6 }, 55 | // Heads 56 | { "progs/h_demon.mdl", 0 }, 57 | { "progs/h_dog.mdl", 0 }, 58 | { "progs/h_guard.mdl", 0 }, 59 | { "progs/h_hellkn.mdl", 0 }, 60 | { "progs/h_knight.mdl", 0 }, 61 | { "progs/h_mega.mdl", 0 }, 62 | { "progs/h_ogre.mdl", 0 }, 63 | { "progs/h_player.mdl", 0 }, 64 | { "progs/h_shal.mdl", 0 }, 65 | { "progs/h_shams.mdl", 0 }, 66 | { "progs/h_wizard.mdl", 0 }, 67 | { "progs/h_zombie.mdl", 0 }, 68 | // Gibs 69 | { "progs/gib1.mdl", 0 }, 70 | { "progs/gib2.mdl", 0 }, 71 | { "progs/gib3.mdl", 0 }, 72 | }; 73 | #pragma warning enable F317 74 | 75 | void misc_corpse() 76 | { 77 | if(self.style < 0 || self.style >= poses.length) 78 | { 79 | objerror("misc_corpse with invalid style."); 80 | return; 81 | } 82 | poseInfo pose = poses[self.style]; 83 | precache_model(pose.mdl); 84 | self.frame = pose.frame; 85 | self.solid = SOLID_NOT; 86 | self.movetype = MOVETYPE_NONE; 87 | setmodel (self, pose.mdl); 88 | } 89 | 90 | void printCorpseFGDStuff() 91 | { 92 | dprint("Corpseframes:\n"); 93 | for(float i = 0; i < poses.length; i++) 94 | { 95 | //style == 0 -> { path: "progs/demon.mdl" , frame: 53 }, 96 | dprint("style == "); 97 | dprint(ftos(i)); 98 | dprint(" -> { path: \""); 99 | dprint(poses[i].mdl); 100 | dprint("\"\t, frame: "); 101 | dprint(ftos(poses[i].frame)); 102 | dprint("\t},\n"); 103 | } 104 | } 105 | 106 | //============================================================================ 107 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipdefs.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Level pack definitons 21 | 22 | */ 23 | 24 | entity nullentity; 25 | entity bulletholes; 26 | entity lastbullet; 27 | float numbulletholes; 28 | float IT_MJOLNIR = 128; 29 | float IT_LASER_CANNON = 8388608; 30 | float IT_PROXIMITY_GUN = 65536; 31 | float HIP_IT_WETSUIT = 2; 32 | float HIP_IT_EMPATHY_SHIELDS = 4; 33 | float HIP_IT_HORN_OF_CONJURING = 8; 34 | //added update stat message 35 | float SVC_UPDATESTAT = 3; 36 | float SVC_CUTSCENE = 34; 37 | //added total monster message 38 | float STAT_TOTALMONSTERS = 12; 39 | float STAT_TOTALSECRETS = 11; 40 | .void() th_turn; 41 | float AS_DODGING = 5; 42 | float CHARMED_RADIUS = 1500; 43 | float MAX_CHARMER_DISTANCE = 200; 44 | float MIN_CHARMER_DISTANCE = 150; 45 | float TOOCLOSE_CHARMER_DISTANCE = 120; 46 | float visible_distance; 47 | entity damage_inflictor; 48 | float footsteps; 49 | 50 | 51 | //MED 11/09/96 added new spawnflags 52 | float SPAWNFLAG_SUPERSPIKE = 1; 53 | float SPAWNFLAG_LASER = 2; 54 | float SPAWNFLAG_LAVABALL = 4; 55 | float SPAWNFLAG_ROCKET = 8; 56 | float SPAWNFLAG_SILENT = 16; 57 | 58 | // Hipnotic Constants 59 | float MIN_ANGLE_DELTA = 10; 60 | 61 | .float wetsuit_finished; 62 | .float wetsuit_time; 63 | .float empathy_finished; 64 | .float empathy_time; 65 | .float empathy_sound; 66 | .float color; 67 | 68 | // 69 | // Hipnotic entries 70 | // 71 | // have to use a new items flag because we ran out of bits in the original 72 | .float items2; 73 | // gremlin stuff 74 | .float gorging; 75 | .float stoleweapon; 76 | .entity lastvictim; 77 | // spawn variables 78 | .void() spawnfunction; 79 | .string spawnclassname; 80 | .float spawnsolidtype; 81 | .string spawnmodel; 82 | .void() spawnthink; 83 | .entity spawnmaster; 84 | .vector spawnmins; 85 | .vector spawnmaxs; 86 | .float spawnsilent; 87 | .float spawnmulti; 88 | // horn of conjuring 89 | .float charmed; 90 | .entity charmer; 91 | .float huntingcharmer; 92 | float horn_active; 93 | entity horn_charmer; 94 | // laser cannon 95 | .vector old_velocity; 96 | //misc 97 | .float duration; 98 | // used for linked list of entities 99 | .entity next_ent; 100 | // Mjolnir 101 | .float struck_by_mjolnir; 102 | // teleport invulnerability 103 | .float last_teleport_time; 104 | 105 | // Rotation 106 | .vector neworigin; 107 | .vector rotate; 108 | .float endtime; 109 | .float rotate_type; 110 | .string path; 111 | .string group; 112 | .string event; 113 | 114 | // Miscellaneous 115 | .float gravity; 116 | 117 | //MED 01/05/97 added discharge variable 118 | float discharged; 119 | //MED 01/05/97 added hipnotic decoy 120 | entity hipdecoy; 121 | // 122 | // Hipnotic's Prototypes 123 | // 124 | void() StopEarthQuake; 125 | void( float value ) EarthQuakeTime; 126 | void() earthquake_postthink; 127 | void() earthquake_prethink; 128 | float( entity counter ) counter_GetCount; 129 | vector ( vector ang ) SUB_NormalizeAngles; 130 | void (entity srcent, entity destent) SUB_CopyEntity; 131 | //multi explosion 132 | void( vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion; 133 | void(string targ, vector orig) become_decoy; 134 | 135 | 136 | //void(vector origin, vector dir, float color, float count, float lifespan) particlestream = #79; 137 | 138 | void() RotateTargets; 139 | void() RotateTargetsFinal; 140 | void() SetTargetOrigin; 141 | void() LinkRotateTargets; 142 | -------------------------------------------------------------------------------- /quakec_hipnotic/hiprubbl.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Rubble QuickC program 21 | By Jim Dose' 9/15/96 22 | */ 23 | 24 | void() hipRubbleTouch = 25 | { 26 | if ( self.ltime < self.pausetime ) 27 | return; 28 | 29 | if (other.takedamage) 30 | { 31 | T_Damage (other, self, self.owner, 10 ); 32 | sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM); 33 | self.pausetime = self.ltime + 0.1; 34 | } 35 | }; 36 | 37 | void(string rubblename) hipThrowRubble = 38 | { 39 | local entity new; 40 | 41 | new = spawn(); 42 | new.origin = self.origin; 43 | setmodel (new, rubblename ); 44 | setsize (new, '0 0 0', '0 0 0'); 45 | new.velocity_x = 70 * crandom(); 46 | new.velocity_y = 70 * crandom(); 47 | new.velocity_z = 140 + 70 * random(); 48 | new.movetype = MOVETYPE_BOUNCE; 49 | new.solid = SOLID_BBOX; 50 | new.avelocity_x = random()*600; 51 | new.avelocity_y = random()*600; 52 | new.avelocity_z = random()*600; 53 | new.think = SUB_Remove; 54 | new.touch = hipRubbleTouch; 55 | new.ltime = time; 56 | new.nextthink = time + 13 + random()*10; 57 | self.pausetime = time; 58 | new.frame = 0; 59 | new.flags = 0; 60 | }; 61 | 62 | void() rubble_use = 63 | { 64 | local float which; 65 | local float index; 66 | 67 | index = 0; 68 | 69 | do 70 | { 71 | which = self.cnt; 72 | if ( self.cnt == 0 ) 73 | { 74 | which = 1 + 3*random(); 75 | which = floor( which ); 76 | } 77 | if ( which == 1 ) 78 | { 79 | hipThrowRubble( "progs/rubble1.mdl" ); 80 | } 81 | else if ( which == 2 ) 82 | { 83 | hipThrowRubble( "progs/rubble3.mdl" ); 84 | } 85 | else 86 | { 87 | hipThrowRubble( "progs/rubble2.mdl" ); 88 | } 89 | index = index + 1; 90 | } 91 | while( index < self.count ); 92 | }; 93 | 94 | /*QUAKED func_rubble (0.4 0.4 0.2) (0 0 0) (32 32 32) 95 | Spawns random sized rubble when triggered. 96 | 97 | "count" is the number of pieces of rubble to spawn. Default is 1. 98 | */ 99 | void() func_rubble = 100 | { 101 | precache_model ("progs/rubble1.mdl"); 102 | precache_model ("progs/rubble2.mdl"); 103 | precache_model ("progs/rubble3.mdl"); 104 | precache_sound ("zombie/z_hit.wav"); 105 | self.classname = "rubble"; 106 | self.cnt = 0; 107 | self.use = rubble_use; 108 | }; 109 | 110 | /*QUAKED func_rubble1 (0.4 0.4 0.2) (0 0 0) (8 8 8) 111 | Spawns small rubble when triggered. 112 | 113 | "count" is the number of pieces of rubble to spawn. Default is 1. 114 | */ 115 | void() func_rubble1 = 116 | { 117 | precache_model ("progs/rubble1.mdl"); 118 | precache_sound ("zombie/z_hit.wav"); 119 | self.classname = "rubble1"; 120 | self.cnt = 1; 121 | self.use = rubble_use; 122 | }; 123 | 124 | /*QUAKED func_rubble2 (0.4 0.4 0.2) (0 0 0) (16 16 16) 125 | Spawns medium rubble when triggered. 126 | 127 | "count" is the number of pieces of rubble to spawn. Default is 1. 128 | */ 129 | void() func_rubble2 = 130 | { 131 | precache_model ("progs/rubble3.mdl"); 132 | precache_sound ("zombie/z_hit.wav"); 133 | self.classname = "rubble2"; 134 | self.cnt = 2; 135 | self.use = rubble_use; 136 | }; 137 | 138 | /*QUAKED func_rubble3 (0.4 0.4 0.2) (0 0 0) (32 32 32) 139 | Spawns large rubble when triggered. 140 | 141 | "count" is the number of pieces of rubble to spawn. Default is 1. 142 | */ 143 | void() func_rubble3 = 144 | { 145 | precache_model ("progs/rubble2.mdl"); 146 | precache_sound ("zombie/z_hit.wav"); 147 | self.classname = "rubble3"; 148 | self.cnt = 3; 149 | self.use = rubble_use; 150 | }; 151 | 152 | -------------------------------------------------------------------------------- /quakec_rogue/random.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // Random.qc 21 | 22 | // ======================================================= 23 | // Random Items! 24 | // ======================================================= 25 | 26 | // equal divisions of 1: 27 | // 5: 0.2, 0.4, 0.6, 0.8, 1 28 | // 6: 0.16, 0.33, 0.48, 0.66, 0.83, 1 29 | // 7: 0.14, 0.28, 0.43, 0.56, 0.71, 0.86, 1 30 | // 8: 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875, 1 31 | void() random_pick_type = 32 | { 33 | local float randItem; 34 | 35 | randItem = random(); 36 | 37 | self.touch = powerup_touch; 38 | setsize (self, '-16 -16 -24', '16 16 32'); 39 | 40 | if(randItem < 0.2) 41 | { 42 | self.touch = newitems_touch; 43 | self.noise = "shield/pickup.wav"; 44 | setmodel (self, "progs/shield.mdl"); 45 | self.netname = "$qc_power_shield"; 46 | self.items = 0; 47 | self.items2 = IT2_SHIELD; 48 | // if(norandom == 1) 49 | // self.classname = "item_powerup_shield"; 50 | } 51 | else if (randItem < 0.4) 52 | { 53 | self.touch = newitems_touch; 54 | self.noise = "belt/pickup.wav"; 55 | setmodel (self, "progs/beltup.mdl"); 56 | self.netname = "$qc_anti_grav_belt"; 57 | self.items = 0; 58 | self.items2 = IT2_ANTIGRAV; 59 | // if(norandom == 1) 60 | // self.classname = "item_powerup_belt"; 61 | } 62 | else if (randItem < 0.6) 63 | { 64 | self.noise = "items/protect.wav"; 65 | setmodel (self, "progs/invulner.mdl"); 66 | self.netname = "$qc_pentagram_of_protection"; 67 | self.items = IT_INVULNERABILITY; 68 | self.items2 = 0; 69 | // if(norandom == 1) 70 | // self.classname = "item_artifact_invulnerability"; 71 | } 72 | else if (randItem < 0.8) 73 | { 74 | self.noise = "items/inv1.wav"; 75 | setmodel (self, "progs/invisibl.mdl"); 76 | self.netname = "$qc_ring_of_shadows"; 77 | self.items = IT_INVISIBILITY; 78 | self.items2 = 0; 79 | // if(norandom == 1) 80 | // self.classname = "item_artifact_invisibility"; 81 | } 82 | else 83 | { 84 | self.noise = "items/damage.wav"; 85 | setmodel (self, "progs/quaddama.mdl"); 86 | self.netname = "$qc_quad_damage"; 87 | self.items = IT_QUAD; 88 | self.items2 = 0; 89 | // if(norandom == 1) 90 | // self.classname = "item_artifact_super_damage"; 91 | } 92 | }; 93 | 94 | /*QUAKED item_random_powerup (0 .5 .8) (-16 -16 -24) (16 16 32) 95 | The Random Box! 96 | 97 | Contains a random powerup. 98 | */ 99 | void() item_random_powerup = 100 | { 101 | if (!deathmatch) 102 | { 103 | remove(self); 104 | return; 105 | } 106 | 107 | // Precache the lot of it.... 108 | precache_model ("progs/shield.mdl"); 109 | precache_model ("progs/p_shield.mdl"); 110 | precache_model ("progs/beltup.mdl"); 111 | precache_model ("progs/invulner.mdl"); 112 | precache_model ("progs/invisibl.mdl"); 113 | precache_model ("progs/quaddama.mdl"); 114 | 115 | precache_sound ("items/inv1.wav"); 116 | precache_sound ("items/inv2.wav"); 117 | precache_sound ("items/inv3.wav"); 118 | precache_sound ("items/protect.wav"); 119 | precache_sound ("items/protect2.wav"); 120 | precache_sound ("items/protect3.wav"); 121 | precache_sound ("items/damage.wav"); 122 | precache_sound ("items/damage2.wav"); 123 | precache_sound ("items/damage3.wav"); 124 | 125 | 126 | precache_sound ("belt/pickup.wav"); 127 | precache_sound ("belt/use.wav"); 128 | precache_sound ("belt/fadeout.wav"); 129 | precache_sound ("shield/pickup.wav"); 130 | precache_sound ("shield/hit.wav"); 131 | precache_sound ("shield/fadeout.wav"); 132 | 133 | random_pick_type(); 134 | StartItem (); 135 | }; 136 | 137 | void() random_regen = 138 | { 139 | random_pick_type(); 140 | SUB_regen(); 141 | }; 142 | 143 | -------------------------------------------------------------------------------- /quakec_rogue/newitems.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // New Items 21 | // 22 | // Items added for the Rogue XPACK. 23 | 24 | void() sphere_spawn; 25 | 26 | void(entity theEntity) UpdateAmmoCounts = 27 | { 28 | if ( self.weapon >= IT_LAVA_NAILGUN ) 29 | { 30 | theEntity.ammo_shells = theEntity.ammo_shells1; 31 | theEntity.ammo_nails = theEntity.ammo_lava_nails; 32 | theEntity.ammo_rockets = theEntity.ammo_multi_rockets; 33 | theEntity.ammo_cells = theEntity.ammo_plasma; 34 | } 35 | else 36 | { 37 | theEntity.ammo_shells = theEntity.ammo_shells1; 38 | theEntity.ammo_nails = theEntity.ammo_nails1; 39 | theEntity.ammo_rockets = theEntity.ammo_rockets1; 40 | theEntity.ammo_cells = theEntity.ammo_cells1; 41 | } 42 | }; 43 | 44 | void() newitems_touch = 45 | { 46 | if (other.classname != "player") 47 | return; 48 | if (other.health <= 0) 49 | return; 50 | 51 | // only one per person, please. 52 | if (self.classname == "item_sphere") 53 | if (other.items2 & IT2_V_SPHERE) 54 | return; 55 | 56 | sprint(other, "$qc_got_item", self.netname); 57 | 58 | if (deathmatch) 59 | { 60 | if (self.classname == "item_random_powerup") 61 | { 62 | self.nextthink = time + 60; 63 | self.think = random_regen; 64 | } 65 | else if (self.classname == "item_sphere") 66 | { 67 | self.mdl = self.model; 68 | self.nextthink = time + 60*3; 69 | self.think = SUB_regen; 70 | } 71 | else 72 | { 73 | self.mdl = self.model; 74 | self.nextthink = time + 60; 75 | self.think = SUB_regen; 76 | } 77 | } 78 | 79 | sound (other, CHAN_VOICE, self.noise, 1, ATTN_NORM); 80 | stuffcmd (other, "bf\n"); 81 | self.solid = SOLID_NOT; 82 | other.items = other.items | self.items; 83 | other.items2 = other.items2 | self.items2; 84 | self.model = string_null; 85 | 86 | // do the apropriate action 87 | if (self.netname == "$qc_power_shield") 88 | { 89 | other.shield_time = 1; 90 | other.shield_finished = time + 30; 91 | } 92 | else if (self.netname == "$qc_anti_grav_belt") 93 | { 94 | other.antigrav_time = 1; 95 | other.antigrav_finished = time + 45; 96 | other.gravity = 0.25; 97 | } 98 | else if (self.classname == "item_sphere") 99 | { 100 | other.items2 = other.items2 | IT2_V_SPHERE; 101 | sphere_spawn(); 102 | } 103 | 104 | activator = other; 105 | SUB_UseTargets(); // fire all targets / killtargets 106 | }; 107 | 108 | 109 | /*QUAKED item_powerup_shield (0 .5 .8) (-16 -16 -24) (16 16 32) 110 | The shield upgrade 111 | */ 112 | void() item_powerup_shield = 113 | { 114 | self.touch = newitems_touch; 115 | 116 | precache_model ("progs/shield.mdl"); 117 | precache_model ("progs/p_shield.mdl"); 118 | precache_sound ("shield/pickup.wav"); 119 | precache_sound ("shield/hit.wav"); 120 | precache_sound ("shield/fadeout.wav"); 121 | self.noise = "shield/pickup.wav"; 122 | setmodel (self, "progs/shield.mdl"); 123 | self.netname = "$qc_power_shield"; 124 | self.items2 = IT2_SHIELD; 125 | setsize (self, '-16 -16 -24', '16 16 32'); 126 | StartItem (); 127 | }; 128 | 129 | /*QUAKED item_powerup_belt (0 .5 .8) (-16 -16 -24) (16 16 32) 130 | The anti-grav belt 131 | */ 132 | void() item_powerup_belt = 133 | { 134 | self.touch = newitems_touch; 135 | 136 | precache_model ("progs/beltup.mdl"); 137 | precache_sound ("belt/pickup.wav"); 138 | precache_sound ("belt/use.wav"); 139 | precache_sound ("belt/fadeout.wav"); 140 | self.noise = "belt/pickup.wav"; 141 | setmodel (self, "progs/beltup.mdl"); 142 | self.netname = "$qc_anti_grav_belt"; 143 | self.items2 = IT2_ANTIGRAV; 144 | setsize (self, '-16 -16 -24', '16 16 32'); 145 | StartItem (); 146 | }; 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /quakec_rogue/buttons.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // button and multiple button 21 | 22 | void() button_wait; 23 | void() button_return; 24 | 25 | void() button_wait = 26 | { 27 | self.state = STATE_TOP; 28 | self.nextthink = self.ltime + self.wait; 29 | self.think = button_return; 30 | activator = self.enemy; 31 | SUB_UseTargets(); 32 | self.frame = 1; // use alternate textures 33 | }; 34 | 35 | void() button_done = 36 | { 37 | self.state = STATE_BOTTOM; 38 | }; 39 | 40 | void() button_return = 41 | { 42 | self.state = STATE_DOWN; 43 | SUB_CalcMove (self.pos1, self.speed, button_done); 44 | self.frame = 0; // use normal textures 45 | if (self.health) 46 | self.takedamage = DAMAGE_YES; // can be shot again 47 | }; 48 | 49 | 50 | void() button_blocked = 51 | { // do nothing, just don't ome all the way back out 52 | }; 53 | 54 | 55 | void() button_fire = 56 | { 57 | if (self.state == STATE_UP || self.state == STATE_TOP) 58 | return; 59 | 60 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 61 | 62 | self.state = STATE_UP; 63 | SUB_CalcMove (self.pos2, self.speed, button_wait); 64 | }; 65 | 66 | 67 | void() button_use = 68 | { 69 | self.enemy = activator; 70 | button_fire (); 71 | }; 72 | 73 | void() button_touch = 74 | { 75 | if (other.classname != "player") 76 | return; 77 | self.enemy = other; 78 | button_fire (); 79 | }; 80 | 81 | void() button_killed = 82 | { 83 | self.enemy = damage_attacker; 84 | self.health = self.max_health; 85 | self.takedamage = DAMAGE_NO; // wil be reset upon return 86 | button_fire (); 87 | }; 88 | 89 | 90 | /*QUAKED func_button (0 .5 .8) ? 91 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 92 | 93 | "angle" determines the opening direction 94 | "target" all entities with a matching targetname will be used 95 | "speed" override the default 40 speed 96 | "wait" override the default 1 second wait (-1 = never return) 97 | "lip" override the default 4 pixel lip remaining at end of move 98 | "health" if set, the button must be killed instead of touched 99 | "sounds" 100 | 0) steam metal 101 | 1) wooden clunk 102 | 2) metallic click 103 | 3) in-out 104 | */ 105 | void() func_button = 106 | { 107 | local float gtemp, ftemp; 108 | 109 | if (self.sounds == 0) 110 | { 111 | precache_sound ("buttons/airbut1.wav"); 112 | self.noise = "buttons/airbut1.wav"; 113 | } 114 | if (self.sounds == 1) 115 | { 116 | precache_sound ("buttons/switch21.wav"); 117 | self.noise = "buttons/switch21.wav"; 118 | } 119 | if (self.sounds == 2) 120 | { 121 | precache_sound ("buttons/switch02.wav"); 122 | self.noise = "buttons/switch02.wav"; 123 | } 124 | if (self.sounds == 3) 125 | { 126 | precache_sound ("buttons/switch04.wav"); 127 | self.noise = "buttons/switch04.wav"; 128 | } 129 | 130 | SetMovedir (); 131 | 132 | self.movetype = MOVETYPE_PUSH; 133 | self.solid = SOLID_BSP; 134 | setmodel (self, self.model); 135 | 136 | self.blocked = button_blocked; 137 | self.use = button_use; 138 | 139 | if (self.health) 140 | { 141 | self.max_health = self.health; 142 | self.th_die = button_killed; 143 | self.takedamage = DAMAGE_YES; 144 | } 145 | else 146 | self.touch = button_touch; 147 | 148 | if (!self.speed) 149 | self.speed = 40; 150 | if (!self.wait) 151 | self.wait = 1; 152 | if (!self.lip) 153 | self.lip = 4; 154 | 155 | self.state = STATE_BOTTOM; 156 | 157 | self.pos1 = self.origin; 158 | vector movedir_fabs = { fabs(self.movedir[0]), fabs(self.movedir[1]), fabs(self.movedir[2]) }; 159 | self.pos2 = self.pos1 + ((movedir_fabs * self.size) - self.lip) * self.movedir; 160 | }; 161 | 162 | -------------------------------------------------------------------------------- /quakec_hipnotic/buttons.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // button and multiple button 21 | 22 | void() button_wait; 23 | void() button_return; 24 | 25 | void() button_wait = 26 | { 27 | self.state = STATE_TOP; 28 | self.nextthink = self.ltime + self.wait; 29 | self.think = button_return; 30 | activator = self.enemy; 31 | SUB_UseTargets(); 32 | self.frame = 1; // use alternate textures 33 | }; 34 | 35 | void() button_done = 36 | { 37 | self.state = STATE_BOTTOM; 38 | }; 39 | 40 | void() button_return = 41 | { 42 | self.state = STATE_DOWN; 43 | SUB_CalcMove (self.pos1, self.speed, button_done); 44 | self.frame = 0; // use normal textures 45 | if (self.health) 46 | self.takedamage = DAMAGE_YES; // can be shot again 47 | }; 48 | 49 | 50 | void() button_blocked = 51 | { // do nothing, just don't ome all the way back out 52 | }; 53 | 54 | 55 | void() button_fire = 56 | { 57 | if (self.state == STATE_UP || self.state == STATE_TOP) 58 | return; 59 | 60 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 61 | 62 | self.state = STATE_UP; 63 | SUB_CalcMove (self.pos2, self.speed, button_wait); 64 | }; 65 | 66 | 67 | void() button_use = 68 | { 69 | self.enemy = activator; 70 | button_fire (); 71 | }; 72 | 73 | void() button_touch = 74 | { 75 | if (other.classname != "player") 76 | return; 77 | self.enemy = other; 78 | button_fire (); 79 | }; 80 | 81 | void() button_killed = 82 | { 83 | self.enemy = damage_attacker; 84 | self.health = self.max_health; 85 | self.takedamage = DAMAGE_NO; // wil be reset upon return 86 | button_fire (); 87 | }; 88 | 89 | 90 | /*QUAKED func_button (0 .5 .8) ? 91 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 92 | 93 | "angle" determines the opening direction 94 | "target" all entities with a matching targetname will be used 95 | "speed" override the default 40 speed 96 | "wait" override the default 1 second wait (-1 = never return) 97 | "lip" override the default 4 pixel lip remaining at end of move 98 | "health" if set, the button must be killed instead of touched 99 | "sounds" 100 | 0) steam metal 101 | 1) wooden clunk 102 | 2) metallic click 103 | 3) in-out 104 | */ 105 | void() func_button = 106 | { 107 | local float gtemp, ftemp; 108 | 109 | if (self.sounds == 0) 110 | { 111 | precache_sound ("buttons/airbut1.wav"); 112 | self.noise = "buttons/airbut1.wav"; 113 | } 114 | if (self.sounds == 1) 115 | { 116 | precache_sound ("buttons/switch21.wav"); 117 | self.noise = "buttons/switch21.wav"; 118 | } 119 | if (self.sounds == 2) 120 | { 121 | precache_sound ("buttons/switch02.wav"); 122 | self.noise = "buttons/switch02.wav"; 123 | } 124 | if (self.sounds == 3) 125 | { 126 | precache_sound ("buttons/switch04.wav"); 127 | self.noise = "buttons/switch04.wav"; 128 | } 129 | 130 | SetMovedir (); 131 | 132 | self.movetype = MOVETYPE_PUSH; 133 | self.solid = SOLID_BSP; 134 | setmodel (self, self.model); 135 | 136 | self.blocked = button_blocked; 137 | self.use = button_use; 138 | 139 | if (self.health) 140 | { 141 | self.max_health = self.health; 142 | self.th_die = button_killed; 143 | self.takedamage = DAMAGE_YES; 144 | } 145 | else 146 | self.touch = button_touch; 147 | 148 | if (!self.speed) 149 | self.speed = 40; 150 | if (!self.wait) 151 | self.wait = 1; 152 | if (!self.lip) 153 | self.lip = 4; 154 | 155 | self.state = STATE_BOTTOM; 156 | 157 | self.pos1 = self.origin; 158 | vector movedir_fabs = { fabs(self.movedir[0]), fabs(self.movedir[1]), fabs(self.movedir[2]) }; 159 | self.pos2 = self.pos1 + ((movedir_fabs * self.size) - self.lip) * self.movedir; 160 | }; 161 | 162 | -------------------------------------------------------------------------------- /quakec_ctf/buttons.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // button and multiple button 21 | 22 | void() button_wait; 23 | void() button_return; 24 | 25 | void() button_wait = 26 | { 27 | self.state = STATE_TOP; 28 | self.nextthink = self.ltime + self.wait; 29 | self.think = button_return; 30 | activator = self.enemy; 31 | SUB_UseTargets(); 32 | self.frame = 1; // use alternate textures 33 | }; 34 | 35 | void() button_done = 36 | { 37 | self.state = STATE_BOTTOM; 38 | }; 39 | 40 | void() button_return = 41 | { 42 | self.state = STATE_DOWN; 43 | SUB_CalcMove (self.pos1, self.speed, button_done); 44 | self.frame = 0; // use normal textures 45 | if (self.health) 46 | self.takedamage = DAMAGE_YES; // can be shot again 47 | }; 48 | 49 | 50 | void() button_blocked = 51 | { // do nothing, just don't ome all the way back out 52 | }; 53 | 54 | 55 | void() button_fire = 56 | { 57 | if (self.state == STATE_UP || self.state == STATE_TOP) 58 | return; 59 | 60 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 61 | 62 | self.state = STATE_UP; 63 | SUB_CalcMove (self.pos2, self.speed, button_wait); 64 | }; 65 | 66 | 67 | void() button_use = 68 | { 69 | self.enemy = activator; 70 | button_fire (); 71 | }; 72 | 73 | void() button_touch = 74 | { 75 | if (other.classname != "player" || other.observer) 76 | return; 77 | self.enemy = other; 78 | button_fire (); 79 | }; 80 | 81 | void() button_killed = 82 | { 83 | self.enemy = damage_attacker; 84 | self.health = self.max_health; 85 | self.takedamage = DAMAGE_NO; // wil be reset upon return 86 | button_fire (); 87 | }; 88 | 89 | 90 | /*QUAKED func_button (0 .5 .8) ? 91 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 92 | 93 | "angle" determines the opening direction 94 | "target" all entities with a matching targetname will be used 95 | "speed" override the default 40 speed 96 | "wait" override the default 1 second wait (-1 = never return) 97 | "lip" override the default 4 pixel lip remaining at end of move 98 | "health" if set, the button must be killed instead of touched 99 | "sounds" 100 | 0) steam metal 101 | 1) wooden clunk 102 | 2) metallic click 103 | 3) in-out 104 | */ 105 | void() func_button = 106 | { 107 | local float gtemp, ftemp; 108 | 109 | if (self.sounds == 0) 110 | { 111 | precache_sound ("buttons/airbut1.wav"); 112 | self.noise = "buttons/airbut1.wav"; 113 | } 114 | if (self.sounds == 1) 115 | { 116 | precache_sound ("buttons/switch21.wav"); 117 | self.noise = "buttons/switch21.wav"; 118 | } 119 | if (self.sounds == 2) 120 | { 121 | precache_sound ("buttons/switch02.wav"); 122 | self.noise = "buttons/switch02.wav"; 123 | } 124 | if (self.sounds == 3) 125 | { 126 | precache_sound ("buttons/switch04.wav"); 127 | self.noise = "buttons/switch04.wav"; 128 | } 129 | 130 | SetMovedir (); 131 | 132 | self.movetype = MOVETYPE_PUSH; 133 | self.solid = SOLID_BSP; 134 | setmodel (self, self.model); 135 | 136 | self.blocked = button_blocked; 137 | self.use = button_use; 138 | 139 | if (self.health) 140 | { 141 | self.max_health = self.health; 142 | self.th_die = button_killed; 143 | self.takedamage = DAMAGE_YES; 144 | } 145 | else 146 | self.touch = button_touch; 147 | 148 | if (!self.speed) 149 | self.speed = 40; 150 | if (!self.wait) 151 | self.wait = 1; 152 | if (!self.lip) 153 | self.lip = 4; 154 | 155 | self.state = STATE_BOTTOM; 156 | 157 | self.pos1 = self.origin; 158 | self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); 159 | }; 160 | 161 | -------------------------------------------------------------------------------- /quakec/buttons.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // button and multiple button 21 | 22 | void() button_wait; 23 | void() button_return; 24 | 25 | void() button_wait = 26 | { 27 | self.state = STATE_TOP; 28 | self.nextthink = self.ltime + self.wait; 29 | self.think = button_return; 30 | activator = self.enemy; 31 | SUB_UseTargets(); 32 | self.frame = 1; // use alternate textures 33 | }; 34 | 35 | void() button_done = 36 | { 37 | self.state = STATE_BOTTOM; 38 | }; 39 | 40 | void() button_return = 41 | { 42 | self.state = STATE_DOWN; 43 | SUB_CalcMove (self.pos1, self.speed, button_done); 44 | self.frame = 0; // use normal textures 45 | 46 | if (self.health) 47 | self.takedamage = DAMAGE_YES; // can be shot again 48 | }; 49 | 50 | 51 | void() button_blocked = 52 | { // do nothing, just don't ome all the way back out 53 | }; 54 | 55 | 56 | void() button_fire = 57 | { 58 | if (self.state == STATE_UP || self.state == STATE_TOP) 59 | return; 60 | 61 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 62 | 63 | self.state = STATE_UP; 64 | SUB_CalcMove (self.pos2, self.speed, button_wait); 65 | }; 66 | 67 | 68 | void() button_use = 69 | { 70 | self.enemy = activator; 71 | button_fire (); 72 | }; 73 | 74 | void() button_touch = 75 | { 76 | if (other.classname != "player") 77 | return; 78 | 79 | self.enemy = other; 80 | button_fire (); 81 | }; 82 | 83 | void() button_killed = 84 | { 85 | self.enemy = damage_attacker; 86 | self.health = self.max_health; 87 | self.takedamage = DAMAGE_NO; // wil be reset upon return 88 | button_fire (); 89 | }; 90 | 91 | 92 | /*QUAKED func_button (0 .5 .8) ? 93 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 94 | 95 | "angle" determines the opening direction 96 | "target" all entities with a matching targetname will be used 97 | "speed" override the default 40 speed 98 | "wait" override the default 1 second wait (-1 = never return) 99 | "lip" override the default 4 pixel lip remaining at end of move 100 | "health" if set, the button must be killed instead of touched 101 | "sounds" 102 | 0) steam metal 103 | 1) wooden clunk 104 | 2) metallic click 105 | 3) in-out 106 | */ 107 | void() func_button = 108 | { 109 | if (self.sounds == 0) 110 | { 111 | precache_sound ("buttons/airbut1.wav"); 112 | self.noise = "buttons/airbut1.wav"; 113 | } 114 | 115 | if (self.sounds == 1) 116 | { 117 | precache_sound ("buttons/switch21.wav"); 118 | self.noise = "buttons/switch21.wav"; 119 | } 120 | 121 | if (self.sounds == 2) 122 | { 123 | precache_sound ("buttons/switch02.wav"); 124 | self.noise = "buttons/switch02.wav"; 125 | } 126 | 127 | if (self.sounds == 3) 128 | { 129 | precache_sound ("buttons/switch04.wav"); 130 | self.noise = "buttons/switch04.wav"; 131 | } 132 | 133 | SetMovedir (); 134 | 135 | self.classname = "func_button"; 136 | self.movetype = MOVETYPE_PUSH; 137 | self.solid = SOLID_BSP; 138 | setmodel (self, self.model); 139 | 140 | self.blocked = button_blocked; 141 | self.use = button_use; 142 | 143 | if (self.health) 144 | { 145 | self.max_health = self.health; 146 | self.th_die = button_killed; 147 | self.takedamage = DAMAGE_YES; 148 | } 149 | else 150 | self.touch = button_touch; 151 | 152 | if (!self.speed) 153 | self.speed = 40; 154 | 155 | if (!self.wait) 156 | self.wait = 1; 157 | 158 | if (!self.lip) 159 | self.lip = 4; 160 | 161 | self.state = STATE_BOTTOM; 162 | 163 | self.pos1 = self.origin; 164 | vector movedir_fabs = { fabs(self.movedir[0]), fabs(self.movedir[1]), fabs(self.movedir[2]) }; 165 | self.pos2 = self.pos1 + ((movedir_fabs * self.size) - self.lip) * self.movedir; 166 | }; 167 | 168 | -------------------------------------------------------------------------------- /quakec_rogue/newmisc.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // Miscellaneous items used in the Rogue XPACK 21 | 22 | 23 | /*QUAKED light_lantern (0 .5 0) (-10 -10 -20) (10 10 20) 24 | Light-emitting lantern. 25 | Default light value is 200 26 | Default style is 0 27 | */ 28 | void() light_lantern = 29 | { 30 | precache_model ("progs/lantern.mdl"); 31 | setmodel (self, "progs/lantern.mdl"); 32 | makestatic (self); 33 | }; 34 | 35 | /*QUAKED light_candle (0 .5 0) (-4 -4 -10) (4 4 10) 36 | Candle 37 | Default light value is 200 38 | Default style is 0 39 | */ 40 | void() light_candle = 41 | { 42 | precache_model ("progs/candle.mdl"); 43 | setmodel (self, "progs/candle.mdl"); 44 | makestatic (self); 45 | }; 46 | 47 | // ========================================== 48 | // rubble generator 49 | // ========================================== 50 | void() rubble_touch = 51 | { 52 | if ( other.classname == "player" || other.flags & FL_MONSTER ) 53 | { 54 | if ( vlen ( self.velocity ) > 0) 55 | { 56 | T_Damage ( other, self, self, 10 ); 57 | } 58 | } 59 | }; 60 | 61 | void() rubble_throw = 62 | { 63 | local vector throw; 64 | local entity rubble; 65 | 66 | rubble = find ( world, targetname, self.target ); 67 | throw = normalize ( rubble.origin - self.origin ); 68 | throw_x = throw_x + (random() * 0.2) - 0.1; 69 | throw_y = throw_y + (random() * 0.2) - 0.1; 70 | throw_z = throw_z + (random() * 0.2) - 0.1; 71 | 72 | rubble = spawn (); 73 | rubble.owner = self; 74 | rubble.classname = "rubble"; 75 | rubble.movetype = MOVETYPE_BOUNCE; 76 | rubble.solid = SOLID_BBOX; 77 | rubble.velocity = throw * 300; 78 | setmodel ( rubble, "progs/rubble.mdl"); 79 | setsize ( rubble, '-16 -16 -16', '16 16 16'); 80 | setorigin ( rubble, self.origin ); 81 | rubble.touch = rubble_touch; 82 | 83 | rubble.think = SUB_Remove; 84 | rubble.nextthink = time + 30; 85 | 86 | if (self.spawnflags & 1) 87 | rubble.skin = 1; 88 | else 89 | rubble.skin = 0; 90 | 91 | self.think = rubble_throw; 92 | self.nextthink = time + self.delay; 93 | }; 94 | 95 | void() rubble_use = 96 | { 97 | if (self.wait == 0) 98 | { 99 | self.think = rubble_throw; 100 | self.nextthink = time + self.delay; 101 | self.wait = 1; 102 | } 103 | else 104 | { 105 | self.nextthink = time - 1; 106 | self.wait = 0; 107 | } 108 | }; 109 | 110 | /*QUAKED rubble_generator (1 1 0) (-8 -8 -8) (8 8 8) LavaRock Active 111 | Rubble Generator - cave colored rock chunks flung at the target. Triggering the generator will turn it off and on. 112 | 113 | LavaRock - a lava rock texture, based on rich's pumice 114 | Active - start the generator immediately. 115 | 116 | delay - time between rubble pieces (Default 5 sec) 117 | */ 118 | void() rubble_generator = 119 | { 120 | precache_model ("progs/rubble.mdl"); 121 | 122 | if (!self.target) 123 | objerror ("rubble_generator has no target!"); 124 | 125 | if (!self.delay) 126 | self.delay = 5; 127 | 128 | self.solid = SOLID_NOT; 129 | self.use = rubble_use; 130 | 131 | if (self.spawnflags & 2) 132 | rubble_use(); 133 | }; 134 | 135 | 136 | void() trigEx_die = 137 | { 138 | SUB_UseTargets(); 139 | 140 | self.touch = SUB_Null; 141 | self.nextthink = time + 0.1; 142 | self.think = SUB_Remove; 143 | }; 144 | 145 | /*QUAKED trigger_explosion (.5 .5 .5) ? 146 | Variable sized repeatable trigger. Must be targeted at one or more entities. Only set off when killed, and is only damaged by T_RadiusDamage. 147 | 148 | health: amount of damage needed to set off trigger. 149 | */ 150 | void() trigger_explosion = 151 | { 152 | InitTrigger (); 153 | 154 | if (!self.health) 155 | self.health = 20; 156 | 157 | self.max_health = self.health; 158 | self.th_die = trigEx_die; 159 | self.takedamage = DAMAGE_YES; 160 | self.solid = SOLID_BBOX; 161 | setorigin (self, self.origin); // make sure it links into the world 162 | }; 163 | 164 | -------------------------------------------------------------------------------- /quakec_rogue/elevatr.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // elevator button 21 | // pmack 22 | // sept 96 23 | 24 | float ELVTR_DOWN = 1; 25 | 26 | void() elvtr_button_wait; 27 | void() elvtr_button_return; 28 | 29 | void() elvtr_button_wait = 30 | { 31 | elvButnDir = 0; 32 | if (self.spawnflags & ELVTR_DOWN) 33 | elvButnDir = -1; 34 | else 35 | elvButnDir = 1; 36 | 37 | self.state = STATE_TOP; 38 | self.nextthink = self.ltime + self.wait; 39 | self.think = elvtr_button_return; 40 | activator = self.enemy; 41 | SUB_UseTargets(); 42 | self.frame = 1; // use alternate textures 43 | }; 44 | 45 | void() elvtr_button_done = 46 | { 47 | self.state = STATE_BOTTOM; 48 | }; 49 | 50 | void() elvtr_button_return = 51 | { 52 | self.state = STATE_DOWN; 53 | SUB_CalcMove (self.pos1, self.speed, elvtr_button_done); 54 | self.frame = 0; // use normal textures 55 | if (self.health) 56 | self.takedamage = DAMAGE_YES; // can be shot again 57 | }; 58 | 59 | 60 | void() elvtr_button_blocked = 61 | { // do nothing, just don't ome all the way back out 62 | }; 63 | 64 | 65 | void() elvtr_button_fire = 66 | { 67 | if (self.state == STATE_UP || self.state == STATE_TOP) 68 | return; 69 | 70 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 71 | 72 | self.state = STATE_UP; 73 | SUB_CalcMove (self.pos2, self.speed, elvtr_button_wait); 74 | }; 75 | 76 | 77 | void() elvtr_button_use = 78 | { 79 | self.enemy = activator; 80 | elvtr_button_fire (); 81 | }; 82 | 83 | void() elvtr_button_touch = 84 | { 85 | if (other.classname != "player") 86 | return; 87 | self.enemy = other; 88 | elvtr_button_fire (); 89 | }; 90 | 91 | void() elvtr_button_killed = 92 | { 93 | self.enemy = damage_attacker; 94 | self.health = self.max_health; 95 | self.takedamage = DAMAGE_NO; // wil be reset upon return 96 | elvtr_button_fire (); 97 | }; 98 | 99 | 100 | /*QUAKED func_elvtr_button (0 .5 .8) ? ELVTR_DOWN 101 | ELEVATOR BUTTON ONLY! 102 | 103 | ELVTR_DOWN causes this to be a DOWN button. 104 | Default is UP. 105 | 106 | When a button is touched, it moves some distance in the direction of it's angle, triggers all of it's targets, waits some time, then returns to it's original position where it can be triggered again. 107 | 108 | "angle" determines the opening direction 109 | "target" all entities with a matching targetname will be used 110 | "speed" override the default 40 speed 111 | "wait" override the default 1 second wait (-1 = never return) 112 | "lip" override the default 4 pixel lip remaining at end of move 113 | "health" if set, the button must be killed instead of touched 114 | "sounds" 115 | 0) steam metal 116 | 1) wooden clunk 117 | 2) metallic click 118 | 3) in-out 119 | */ 120 | void() func_elvtr_button = 121 | { 122 | local float gtemp, ftemp; 123 | 124 | if (self.sounds == 0) 125 | { 126 | precache_sound ("buttons/airbut1.wav"); 127 | self.noise = "buttons/airbut1.wav"; 128 | } 129 | if (self.sounds == 1) 130 | { 131 | precache_sound ("buttons/switch21.wav"); 132 | self.noise = "buttons/switch21.wav"; 133 | } 134 | if (self.sounds == 2) 135 | { 136 | precache_sound ("buttons/switch02.wav"); 137 | self.noise = "buttons/switch02.wav"; 138 | } 139 | if (self.sounds == 3) 140 | { 141 | precache_sound ("buttons/switch04.wav"); 142 | self.noise = "buttons/switch04.wav"; 143 | } 144 | 145 | SetMovedir (); 146 | 147 | self.movetype = MOVETYPE_PUSH; 148 | self.solid = SOLID_BSP; 149 | setmodel (self, self.model); 150 | 151 | self.blocked = elvtr_button_blocked; 152 | self.use = elvtr_button_use; 153 | 154 | if (self.health) 155 | { 156 | self.max_health = self.health; 157 | self.th_die = elvtr_button_killed; 158 | self.takedamage = DAMAGE_YES; 159 | } 160 | else 161 | self.touch = elvtr_button_touch; 162 | 163 | if (!self.speed) 164 | self.speed = 40; 165 | if (!self.wait) 166 | self.wait = 1; 167 | if (!self.lip) 168 | self.lip = 4; 169 | 170 | self.state = STATE_BOTTOM; 171 | 172 | self.pos1 = self.origin; 173 | self.pos2 = self.pos1 + self.movedir*(fabs(self.movedir*self.size) - self.lip); 174 | }; 175 | 176 | -------------------------------------------------------------------------------- /quakec_rogue/buzzsaw.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // buzzsaw.qc 21 | 22 | $skin buzzsaw 23 | $frame buzzsaw 24 | $frame bzzrot01 bzzrot02 bzzrot03 bzzrot04 bzzrot05 bzzrot06 25 | 26 | void() buzzsaw_stand1 = [ $buzzsaw, buzzsaw_stand1 ] 27 | { 28 | if ( self.pain_finished < time) 29 | { 30 | sound ( self, CHAN_VOICE, "buzz/buzz1.wav", 0.2, ATTN_NORM); 31 | self.pain_finished = time + 1; 32 | } 33 | 34 | self.angles_x = self.angles_x - 60; 35 | self.avelocity_x = 60; 36 | }; 37 | 38 | void() buzzsaw_fly = 39 | { 40 | local vector dir; 41 | 42 | if ( self.pain_finished < time) 43 | { 44 | sound ( self, CHAN_VOICE, "buzz/buzz1.wav", 0.2, ATTN_NORM); 45 | self.pain_finished = time + 1; 46 | } 47 | 48 | dir = self.goalentity.origin - self.origin; 49 | dir = normalize (dir); 50 | dir = dir * self.speed; 51 | setorigin (self, self.origin + dir); 52 | self.angles_x = self.angles_x - 60; 53 | self.avelocity_x = 60; 54 | }; 55 | 56 | /* 57 | void() buzzsaw_fly1 = [ $bzzrot01, buzzsaw_fly2 ] { buzzsaw_fly(); }; 58 | void() buzzsaw_fly2 = [ $bzzrot02, buzzsaw_fly3 ] { buzzsaw_fly(); }; 59 | void() buzzsaw_fly3 = [ $bzzrot03, buzzsaw_fly4 ] { buzzsaw_fly(); }; 60 | void() buzzsaw_fly4 = [ $bzzrot04, buzzsaw_fly5 ] { buzzsaw_fly(); }; 61 | void() buzzsaw_fly5 = [ $bzzrot05, buzzsaw_fly6 ] { buzzsaw_fly(); }; 62 | void() buzzsaw_fly6 = [ $bzzrot06, buzzsaw_fly1 ] { buzzsaw_fly(); }; 63 | */ 64 | 65 | void() buzzsaw_fly1 = [ $bzzrot01, buzzsaw_fly1 ] { buzzsaw_fly(); }; 66 | 67 | void() buzzsaw_touch = 68 | { 69 | local vector sprayDir; 70 | 71 | if ( other.classname == "player" || other.flags & FL_MONSTER) 72 | { 73 | if ( self.attack_finished < time ) 74 | { 75 | sound (self, CHAN_WEAPON, "buzz/buzz.wav", 1, ATTN_NORM); 76 | self.attack_finished = time + 2; 77 | } 78 | T_Damage (other, self, self, self.currentammo); 79 | 80 | sprayDir = normalize(self.goalentity.origin - self.origin); 81 | sprayDir = sprayDir * 200; 82 | SpawnMeatSpray ( self.origin, sprayDir); 83 | 84 | other.velocity = sprayDir; 85 | other.velocity_z = 200; 86 | } 87 | }; 88 | 89 | void() buzzsaw_use = 90 | { 91 | self.touch = buzzsaw_touch; 92 | if (self.target) 93 | { 94 | self.movetarget = find(world, targetname, self.target); 95 | self.goalentity = self.movetarget; 96 | self.th_stand = buzzsaw_fly1; 97 | self.th_walk = buzzsaw_fly1; 98 | self.th_run = buzzsaw_fly1; 99 | self.think = buzzsaw_fly1; 100 | self.nextthink = time + 0.1; 101 | } 102 | else 103 | { 104 | self.nextthink = time + 0.1; 105 | self.think = buzzsaw_stand1; 106 | } 107 | self.use = SUB_Null; 108 | }; 109 | 110 | /*QUAKED buzzsaw (0 .5 .8) (-18 -18 -18) (18 18 18) Vertical 111 | The buzzsaw trap. 112 | 113 | currentammo: amount of damage for each contact. (default 10) 114 | speed: speed that it will follow it's path. (default 10) 115 | 116 | Use the angle buttons to point the buzzsaw in the direction it 117 | should face. 118 | 119 | Place on a monster path if you want it to move. 120 | 121 | If it is targeted, it will wait until triggered to activate. 122 | 123 | It will not damage players until activated. 124 | */ 125 | void() buzzsaw = 126 | { 127 | precache_model ("progs/buzzsaw.mdl"); 128 | 129 | precache_sound ("buzz/buzz.wav"); 130 | precache_sound ("buzz/buzz1.wav"); 131 | 132 | setmodel (self, "progs/buzzsaw.mdl"); 133 | 134 | self.takedamage = DAMAGE_NO; 135 | self.solid = SOLID_TRIGGER; 136 | self.movetype = MOVETYPE_FLY; 137 | 138 | if(self.angles_y == 0 || self.angles_y == 180) 139 | setsize (self, '-18 0 -18', '18 0 18'); 140 | else if(self.angles_y == 90 || self.angles_y == 270) 141 | setsize (self, '0 -18 -18', '0 18 18'); 142 | else 143 | objerror ("Buzzsaw: Not at 90 degree angle!"); 144 | 145 | setorigin (self, self.origin); 146 | 147 | if (!self.speed) 148 | self.speed = 10; 149 | if (!self.currentammo) 150 | self.currentammo = 10; 151 | 152 | self.pain_finished = time + random()*2; 153 | 154 | if (!self.targetname) 155 | { 156 | self.think = buzzsaw_use; 157 | self.nextthink = time + 0.2; 158 | } 159 | else 160 | { 161 | self.use = buzzsaw_use; 162 | } 163 | }; 164 | 165 | -------------------------------------------------------------------------------- /quakec_ctf/ctfgame.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | float VOTEEXIT_TIME_LIMIT = 60; // 60 seconds after first vote 21 | float voteexit_time; 22 | entity vote_leader; // current leader 23 | entity lastvotespawn; 24 | 25 | void(vector org) spawn_tfog; 26 | void(vector org, entity death_owner) spawn_tdeath; 27 | void() InitTrigger; 28 | 29 | /*QUAKED info_vote_destination (.5 .5 .5) (-8 -8 -8) (8 8 32) 30 | This is the destination marker for a voteexit. It should have a "targetname" 31 | field with the same value as a voteexit's "target" field. 32 | */ 33 | void() info_vote_destination = 34 | { 35 | // this does nothing, just serves as a target spot 36 | self.mangle = self.angles; 37 | self.angles = '0 0 0'; 38 | self.model = ""; 39 | self.origin = self.origin + '0 0 27'; 40 | if (!self.targetname) 41 | objerror ("no targetname"); 42 | }; 43 | 44 | void() voteexit_teleport = 45 | { 46 | local entity t; 47 | local vector org; 48 | 49 | // put a tfog where the player was 50 | spawn_tfog (other.origin); 51 | 52 | t = find (world, targetname, self.target); 53 | 54 | if (!t) 55 | objerror ("couldn't find target"); 56 | 57 | // spawn a tfog flash in front of the destination 58 | makevectors (t.mangle); 59 | org = t.origin + 32 * v_forward; 60 | 61 | spawn_tfog (org); 62 | spawn_tdeath(t.origin, other); 63 | 64 | // move the player and lock him down for a little while 65 | if (!other.health) 66 | { 67 | other.origin = t.origin; 68 | other.velocity = (v_forward * other.velocity_x) + (v_forward * other.velocity_y); 69 | return; 70 | } 71 | setorigin (other, t.origin); 72 | other.angles = t.mangle; 73 | 74 | other.fixangle = 1; // turn this way immediately 75 | other.teleport_time = time + 0.7; 76 | 77 | if (other.flags & FL_ONGROUND) 78 | other.flags = other.flags - FL_ONGROUND; 79 | other.velocity = v_forward * 300; 80 | }; 81 | 82 | void() voteexit_touch = 83 | { 84 | local entity t; 85 | 86 | if (other.classname != "player") 87 | return; 88 | 89 | // only teleport living creatures 90 | if (other.health <= 0 || other.solid != SOLID_SLIDEBOX) 91 | return; 92 | 93 | if (other.voted) { 94 | if (other.voted < time) 95 | centerprint(other, "$qc_ctf_already_voted"); 96 | other.voted = time + 1; 97 | voteexit_teleport(); 98 | return; 99 | } 100 | 101 | // non-zero for vote, time is when to display a 'you voted' msg 102 | other.voted = time + 1; 103 | 104 | SUB_UseTargets (); 105 | 106 | bprint("$qc_ctf_has_voted", other.netname, self.message); 107 | 108 | // ok, the player has voted for this exit 109 | self.cnt = self.cnt + 1; 110 | 111 | // find new leader 112 | // we're on the start map, something special is happening 113 | vote_leader = world; 114 | t = find(world, classname, "trigger_voteexit"); 115 | while (t != world) { 116 | if ((t.cnt > vote_leader.cnt) && (t != self)) 117 | vote_leader = t; 118 | t = find(t, classname, "trigger_voteexit"); 119 | } 120 | // if we are higher than the current leader, then we are the new 121 | // leader, if we are same, half chance 122 | if (self.cnt > vote_leader.cnt) 123 | vote_leader = self; 124 | else if ((self.cnt == vote_leader.cnt) && (random() > 0.5)) 125 | vote_leader = self; 126 | 127 | // we check here about exit time 128 | if (vote_leader != world && voteexit_time == 0) 129 | voteexit_time = time + VOTEEXIT_TIME_LIMIT; 130 | 131 | voteexit_teleport(); 132 | }; 133 | 134 | /*QUAKED trigger_voteexit (.5 .5 .5) ? 135 | A merge of trigger_changelevel and trigger_teleport. A player touching 136 | this this teleported just like a trigger_teleport, except this triggers 137 | .cnt field gets incremented. This allows players to vote for their exit. 138 | See status.qc for the display and total of the voting. 139 | Any object touching this will be transported to the corresponding 140 | info_vote_destination entity. You must set the "target" field, and 141 | create an object with a "targetname" field that matches. 142 | */ 143 | void() trigger_voteexit = 144 | { 145 | local vector o; 146 | 147 | InitTrigger (); 148 | self.touch = voteexit_touch; 149 | self.cnt = 0; 150 | // find the destination 151 | objerror ("no target"); 152 | }; 153 | 154 | -------------------------------------------------------------------------------- /quakec_rogue/earthq.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // earthquake 21 | 22 | // ============================================================ 23 | // Level-Wide Earthquakes 24 | // ============================================================ 25 | float EQ_RANDOM = 1; 26 | 27 | void() stop_earthquake; 28 | 29 | void() earthquake_rumble = 30 | { 31 | if (self.attack_finished < time) 32 | stop_earthquake(); 33 | else 34 | { 35 | sound( self, CHAN_VOICE, "equake/rumble.wav", 1, ATTN_NONE ); 36 | self.think = earthquake_rumble; 37 | self.nextthink = time + 1; 38 | } 39 | }; 40 | 41 | void() start_earthquake = 42 | { 43 | earthquake_active = 1; 44 | if ( self.spawnflags & EQ_RANDOM ) 45 | self.attack_finished = time + random() * self.delay; 46 | else 47 | self.attack_finished = time + self.delay; 48 | earthquake_rumble(); 49 | }; 50 | 51 | void() stop_earthquake = 52 | { 53 | earthquake_active = 0; 54 | self.think = start_earthquake; 55 | if ( self.spawnflags & EQ_RANDOM ) 56 | self.nextthink = time + random() * self.wait; 57 | else 58 | self.nextthink = time + self.wait; 59 | }; 60 | 61 | /*QUAKED earthquake (0 1 0) (-8 -8 -8) (8 8 8) Random 62 | The Earthquake generator. 63 | 64 | delay - duration of the tremor (default 20) 65 | wait - time between tremors (default 60) 66 | weapon - richter scale of movement (default 40) 67 | 68 | RANDOM affects the times only. It will change the randomly between 69 | 0-n where n is the duration or time between. 70 | 71 | weapon - if you give a weapon value of 40, the X and Y displacement 72 | can vary between -20 and +20, a range of 40. 73 | */ 74 | void() earthquake = 75 | { 76 | if (!self.delay) 77 | self.delay = 20; 78 | if (!self.wait) 79 | self.wait = 60; 80 | if (!self.weapon) 81 | self.weapon = 40; 82 | 83 | precache_sound ("equake/rumble.wav"); 84 | earthquake_active = 0; 85 | earthquake_intensity = self.weapon * 0.5; 86 | 87 | setsize (self, '0 0 0', '0 0 0'); 88 | self.think = stop_earthquake; 89 | self.nextthink = time + 1; 90 | }; 91 | 92 | // ============================================================ 93 | // Earthquake trigger 94 | // ============================================================ 95 | void() earthquake_touch = 96 | { 97 | if (self.delay) 98 | { 99 | if ( self.attack_finished < time ) 100 | { 101 | sound ( self, CHAN_VOICE, "equake/rumble.wav", 1, ATTN_NORM ); 102 | self.attack_finished = time + 1; 103 | } 104 | 105 | if ( other.classname == "player" ) 106 | { 107 | if ( other.flags & FL_ONGROUND ) 108 | { 109 | other.velocity_x = other.velocity_x + 110 | (random() * self.weapon * 2) - 111 | self.weapon; 112 | other.velocity_y = other.velocity_y + 113 | (random() * self.weapon * 2) - 114 | self.weapon; 115 | other.velocity_z = other.velocity_z + 116 | (random() * self.weapon * 2) - 117 | self.weapon; 118 | } 119 | } 120 | } 121 | }; 122 | 123 | void() earthquake_use = 124 | { 125 | self.delay = !self.delay; 126 | }; 127 | 128 | /*QUAKED trigger_earthquake (.5 .5 .5) ? 129 | The Earthquake generator. 130 | 131 | Anytime a person is in an active field, they shake. If the trigger is a target, it will be OFF until triggered. It will then toggle between ON and OFF. 132 | 133 | weapon - richter scale of movement (default 40) 134 | 135 | weapon - if you give a weapon value of 40, the X and Y displacement 136 | can vary between -20 and +20, a range of 40. 137 | */ 138 | void() trigger_earthquake = 139 | { 140 | precache_sound ("equake/rumble.wav"); 141 | 142 | if (!self.weapon) 143 | self.weapon = 40; 144 | 145 | self.weapon = self.weapon * 0.5; 146 | self.delay = 1; 147 | self.touch = earthquake_touch; 148 | 149 | if (self.targetname) 150 | { 151 | self.use = earthquake_use; 152 | self.delay = 0; 153 | } 154 | 155 | InitTrigger(); 156 | }; 157 | 158 | void() kill_earthquake = 159 | { 160 | local entity eq; 161 | 162 | if ( other.classname != "player" ) 163 | return; 164 | 165 | eq = find (world, classname, "earthquake"); 166 | if (eq != world) 167 | { 168 | earthquake_active = 0; 169 | remove (eq); 170 | } 171 | }; 172 | 173 | /*QUAKED trigger_earthquake_kill (.5 .5 .5) ? 174 | Trigger to kill the level-wide earthquake. 175 | */ 176 | void() trigger_earthquake_kill = 177 | { 178 | self.touch = kill_earthquake; 179 | 180 | InitTrigger(); 181 | }; -------------------------------------------------------------------------------- /quakec_rogue/sphere.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // vengeance sphere 21 | 22 | // ============================== 23 | // sphere_impact 24 | // ============================== 25 | void() sphere_impact = 26 | { 27 | if (other.health) 28 | { 29 | T_Damage (other, self, self, 1000 ); 30 | } 31 | 32 | // don't do radius damage to the other, because all the damage 33 | // was done in the impact 34 | T_RadiusDamage (self, self, 300, other); 35 | 36 | // sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM); 37 | self.origin = self.origin - 8*normalize(self.velocity); 38 | 39 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 40 | WriteByte (MSG_BROADCAST, TE_EXPLOSION); 41 | WriteCoord (MSG_BROADCAST, self.origin_x); 42 | WriteCoord (MSG_BROADCAST, self.origin_y); 43 | WriteCoord (MSG_BROADCAST, self.origin_z); 44 | 45 | BecomeExplosion (); 46 | }; 47 | 48 | void(entity ownerEntity) sphere_remove = 49 | { 50 | local entity theSphere; 51 | 52 | theSphere = find(world, classname, "Vengeance"); 53 | while(theSphere != world) 54 | { 55 | if(theSphere.owner == self) 56 | { 57 | bprint("$qc_death_denied_vengance", theSphere.owner.netname); 58 | remove(theSphere); 59 | theSphere = find(world, classname, "Vengeance"); 60 | } 61 | else 62 | theSphere = find(theSphere, classname, "Vengeance"); 63 | } 64 | }; 65 | 66 | // ============================== 67 | // sphere_attack 68 | // ============================== 69 | void() sphere_attack = 70 | { 71 | self.solid = SOLID_TRIGGER; 72 | self.touch = sphere_impact; 73 | 74 | if (self.enemy.health < 1) 75 | { 76 | sprint ( self.owner, "$qc_you_are_denied_vengeance"); 77 | remove(self); 78 | return; 79 | } 80 | 81 | ai_track(self.enemy, 650); 82 | self.nextthink = time + 0.1; 83 | self.think = sphere_attack; 84 | }; 85 | 86 | // ============================== 87 | // sphere_think 88 | // ============================== 89 | void() sphere_think = 90 | { 91 | if (self.shieldSoundTime < time) 92 | { 93 | sound ( self, CHAN_VOICE, "sphere/sphere.wav", 1, ATTN_NORM); 94 | self.shieldSoundTime = time + 4; 95 | } 96 | 97 | if (time > self.delay) 98 | { 99 | if (self.owner.items2 & IT2_V_SPHERE) 100 | self.owner.items2 = self.owner.items2 - IT2_V_SPHERE; 101 | sprint ( self.owner, "$qc_vengeance_lost"); 102 | remove (self); 103 | return; 104 | } 105 | 106 | if (self.owner.health < 1) 107 | { 108 | if (self.owner.items2 & IT2_V_SPHERE) 109 | self.owner.items2 = self.owner.items2 - IT2_V_SPHERE; 110 | if ( self.owner.enemy.classname == "player" ) 111 | { 112 | self.enemy = self.owner.enemy; 113 | sphere_attack(); 114 | return; 115 | } 116 | if ( self.owner.enemy.owner.classname == "player") 117 | { 118 | self.enemy = self.owner.enemy.owner; 119 | sphere_attack(); 120 | return; 121 | } 122 | remove (self); 123 | return; 124 | } 125 | 126 | ai_orbit(self.owner, 16, '0 0 48'); 127 | 128 | self.think = sphere_think; 129 | self.nextthink = time + 0.1; 130 | }; 131 | 132 | // ============================== 133 | // sphere_spawn 134 | // ============================== 135 | void() sphere_spawn = 136 | { 137 | local entity missile; 138 | 139 | missile = spawn(); 140 | missile.movetype = MOVETYPE_FLYMISSILE; 141 | // missile.solid = SOLID_BBOX; 142 | missile.solid = SOLID_NOT; 143 | missile.classname = "Vengeance"; 144 | missile.owner = other; 145 | missile.weapon = 0; 146 | missile.delay = time + 30; 147 | setmodel (missile, "progs/sphere.mdl"); 148 | setsize (missile, '0 0 0', '0 0 0'); 149 | setorigin (missile, self.origin ); 150 | missile.avelocity = '40 40 40'; 151 | missile.think = sphere_think; 152 | missile.nextthink = time + 0.1; 153 | }; 154 | 155 | /*QUAKED item_sphere (0 0 1) (-8 -8 -8) (8 8 8) ? 156 | The $qc_vengeance_sphere. DEATHMATCH ONLY. 157 | */ 158 | void() item_sphere = 159 | { 160 | if (!deathmatch) 161 | { 162 | remove(self); 163 | return; 164 | } 165 | 166 | precache_model ("progs/sphere.mdl"); 167 | precache_sound ("sphere/sphere.wav"); 168 | 169 | self.noise = "sphere/sphere.wav"; 170 | self.netname = "$qc_vengeance_sphere"; 171 | self.touch = newitems_touch; 172 | 173 | setmodel (self, "progs/sphere.mdl"); 174 | setsize (self, '-8 -8 -8', '8 8 8'); 175 | self.avelocity = '40 40 40'; 176 | StartItem (); 177 | }; 178 | -------------------------------------------------------------------------------- /quakec_rogue/new_ai.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // new ai functions 21 | // 22 | // pmack 23 | 24 | // ================================================================ 25 | // ai_orbit - used to have an object orbit an entity. 26 | // 27 | // destEnt: the entity to orbit 28 | // radius: how large a radius to orbit at (0 will just track) 29 | // offset: center of the orbit. this is added to dest.origin. 30 | // 31 | // Uses self.orbitPosition to determine current destination. 32 | // ================================================================ 33 | void(entity destEnt, float radius, vector offset) ai_orbit = 34 | { 35 | local vector dir; 36 | local float dist; 37 | 38 | if (self.orbitPosition > 3) 39 | self.orbitPosition = 0; 40 | else if (self.orbitPosition < 0) 41 | self.orbitPosition = 0; 42 | 43 | traceline ( self.origin, destEnt.origin + offset, TRUE, world); 44 | if ( trace_fraction < 1 ) 45 | { 46 | setorigin (self, destEnt.origin + offset); 47 | self.orbitPosition = self.orbitPosition + 1; 48 | return; 49 | } 50 | 51 | if ( self.orbitPosition == 0) 52 | { 53 | dir = (destEnt.origin + offset) - self.origin; 54 | dir_x = dir_x + radius; 55 | } 56 | else if ( self.orbitPosition == 1) 57 | { 58 | dir = (destEnt.origin + offset) - self.origin; 59 | dir_y = dir_y + radius; 60 | } 61 | else if ( self.orbitPosition == 2) 62 | { 63 | dir = (destEnt.origin + offset) - self.origin; 64 | dir_x = dir_x - radius; 65 | } 66 | else 67 | { 68 | dir = (destEnt.origin + offset) - self.origin; 69 | dir_y = dir_y - radius; 70 | } 71 | 72 | dist = vlen(dir); 73 | 74 | if( dist < 8 ) 75 | { 76 | self.orbitPosition = self.orbitPosition + 1; 77 | } 78 | else if( dist < 50 ) 79 | { 80 | self.velocity = normalize(dir); 81 | self.velocity = self.velocity * 150; 82 | } 83 | else 84 | { 85 | self.velocity = normalize(dir); 86 | self.velocity = self.velocity * 500; 87 | } 88 | }; 89 | 90 | // ================================================================ 91 | // ai_track - used to have an object chase/track an enemy. the object 92 | // flies directly at the destEnt's view_ofs point. 93 | // 94 | // destEnt: the entity to orbit 95 | // trackSpeed: the velocity multiplier (speed) of the object 96 | // ================================================================ 97 | void(entity destEnt, float trackSpeed) ai_track = 98 | { 99 | local vector dir; 100 | 101 | dir = destEnt.origin + destEnt.view_ofs; 102 | dir = normalize(dir - self.origin); 103 | self.velocity = dir * trackSpeed; 104 | }; 105 | 106 | // ================================================================ 107 | // ViolentDeath 108 | // ================================================================ 109 | 110 | void(string gibname, float dm) AccelerateGib = 111 | { 112 | local entity new; 113 | 114 | local float offset1; 115 | 116 | new = spawn(); 117 | new.origin = self.origin; 118 | setmodel (new, gibname); 119 | setsize (new, '-8 -8 -8', '8 8 8'); 120 | 121 | new.velocity = -1.25 * self.velocity; 122 | makevectors ( new.velocity ); 123 | offset1 = random() * 300 - 150; 124 | new.velocity = new.velocity + v_right * offset1; 125 | offset1 = random() * 300 - 150; 126 | new.velocity = new.velocity + v_up * offset1; 127 | 128 | 129 | new.movetype = MOVETYPE_BOUNCE; 130 | new.solid = SOLID_NOT; 131 | new.avelocity_x = random()*600; 132 | new.avelocity_y = random()*600; 133 | new.avelocity_z = random()*600; 134 | new.think = SUB_Remove; 135 | new.ltime = time; 136 | new.nextthink = time + 10 + random()*10; 137 | new.frame = 0; 138 | new.flags = 0; 139 | }; 140 | 141 | void(float gibCount) ViolentDeath = 142 | { 143 | while(gibCount > 0) 144 | { 145 | AccelerateGib ("progs/gib1.mdl", (-4 * gibCount)); 146 | AccelerateGib ("progs/gib2.mdl", (-6 * gibCount)); 147 | AccelerateGib ("progs/gib3.mdl", (-8 * gibCount)); 148 | gibCount = gibCount - 3; 149 | } 150 | }; 151 | 152 | entity(string gibname) StartGib = 153 | { 154 | local entity new; 155 | 156 | new = spawn(); 157 | new.origin = self.origin; 158 | setmodel (new, gibname); 159 | setsize (new, '0 0 0', '0 0 0'); 160 | 161 | new.movetype = MOVETYPE_BOUNCE; 162 | new.solid = SOLID_NOT; 163 | new.think = SUB_Remove; 164 | new.ltime = time; 165 | new.nextthink = time + 10 + random()*10; 166 | new.frame = 0; 167 | new.flags = 0; 168 | 169 | return new; 170 | }; 171 | 172 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipmodel.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | 21 | /* 22 | =============================================================================== 23 | 24 | HIP WEAPONS 25 | 26 | =============================================================================== 27 | */ 28 | 29 | $modelname g_hammer 30 | $cd hipwork/models/g_hammer 31 | $origin 0 0 -24 32 | $scale 1 33 | $flags 8 // client side rotate 34 | $base mjolbase.asc 35 | $skin skin 36 | $frame mjol.asc 37 | 38 | 39 | $modelname g_laserg 40 | $cd hipwork/models/g_laserg 41 | $scale 1 42 | $flags 8 // client side rotate 43 | $origin 0 0 -24 44 | $base base.asc 45 | $skin skin 46 | $frame frame1.asc 47 | 48 | $modelname g_prox 49 | $cd hipwork/models/g_prox 50 | $scale 1 51 | $flags 8 // client side rotate 52 | $origin 0 0 -24 53 | $base base 54 | $skin skin 55 | $frame frame1 56 | 57 | 58 | /* 59 | =============================================================================== 60 | 61 | VIEW WEAPONS 62 | 63 | =============================================================================== 64 | */ 65 | 66 | $modelname v_hammer 67 | $cd hipwork/models/v_hammer 68 | $origin 0 5 54 69 | $base v_base.asc 70 | $skin mjol 71 | $frame strike1.asc strike2.asc strike3.asc strike4.asc strike5.asc 72 | 73 | 74 | $modelname v_laserg 75 | $cd hipwork/models/v_laserg 76 | $scale 1.5 77 | $origin 0 -19.5 49 78 | $base firebase.asc 79 | $skin skin 80 | $frame fire1.asc fire2.asc fire3.asc fire4.asc fire5.asc fire6.asc fire7.asc 81 | 82 | $modelname v_prox 83 | $cd hipwork/models/v_prox 84 | $origin 0 0 54 85 | $base base 86 | $skin skin 87 | $frame shot1 shot2 shot3 shot4 shot5 shot6 shot6 88 | 89 | /* 90 | =============================================================================== 91 | 92 | ITEMS 93 | 94 | =============================================================================== 95 | */ 96 | 97 | 98 | $modelname empathy 99 | $cd hipwork/models/empathy 100 | $flags 8 // client side rotate 101 | $origin 0 0 -40 102 | $scale 2.5 103 | $base base.asc 104 | $skin skin 105 | $frame frame1.asc 106 | 107 | $modelname wetsuit 108 | $cd hipwork/models/wetsuit 109 | $flags 8 // client side rotate 110 | $base suitbase.asc 111 | $skin skin 112 | $frame suit.asc 113 | 114 | $modelname horn 115 | $cd hipwork/models/horn 116 | $origin 0 0 16 117 | $scale 2.75 118 | $flags 8 // client side rotate 119 | $base base.asc 120 | $skin skin 121 | $frame frame1.asc 122 | 123 | $modelname spikmine 124 | $cd hipwork/models/spike 125 | $origin 0 0 0 126 | $base spikbase.asc 127 | $skin spike 128 | $frame spike1.asc spike2.asc spike3.asc spike4.asc spike5.asc spike6.asc 129 | $frame spike7.asc spike8.asc spike9.asc 130 | 131 | $modelname proxbomb 132 | $cd hipwork/models/proxbomb 133 | $origin 0 0 0 134 | $scale 1.5 135 | $base base.asc 136 | $skin skin2 137 | $frame frame1.asc 138 | 139 | /* 140 | =============================================================================== 141 | 142 | GIBS 143 | 144 | =============================================================================== 145 | */ 146 | $modelname rubble2 147 | $cd hipwork/models/rubble2 148 | $flags 2 // EF_GRENADE 149 | $origin 0 0 0 150 | $base base 151 | $skin skin 152 | $skin skin2 153 | $skin skin3 154 | $frame frame1 155 | 156 | 157 | $modelname rubble1 158 | $cd hipwork/models/rubble1 159 | $flags 2 // EF_GRENADE 160 | $origin 0 0 0 161 | $base base 162 | //$skin skin 163 | //$skin skin2 164 | $skin skin3 165 | $frame frame1 166 | 167 | 168 | $modelname rubble3 169 | $cd hipwork/models/rubble3 170 | $flags 2 // EF_GRENADE 171 | $origin 0 0 0 172 | $base base 173 | $skin skin 174 | $skin skin2 175 | $skin skin3 176 | $frame frame1 177 | 178 | $modelname h_scourg 179 | $cd hipwork/models/h_scourg 180 | $flags 4 // EF_GIB 181 | $scale 2.0 182 | $origin 0 0 0 183 | $base h_base.asc 184 | $skin skin 185 | $frame head.asc 186 | 187 | $modelname h_grem 188 | $cd hipwork/models/h_grem 189 | $flags 4 // EF_GIB 190 | $scale 3.0 191 | $origin 0 0 0 192 | $base h_base.asc 193 | $skin skin 194 | $frame head.asc 195 | 196 | /* 197 | =============================================================================== 198 | 199 | MISC 200 | 201 | =============================================================================== 202 | */ 203 | 204 | $modelname lasrspik 205 | $cd hipwork/models/lasrspik 206 | $origin 0 0 0 207 | $scale 2.3 208 | $base base 209 | $skin skin 210 | $frame frame1 211 | 212 | $modelname lavarock 213 | $cd hipwork/models/lava2 214 | $flags 1 // EF_ROCKET 215 | $origin 0 0 8 216 | //$scale 0.7 217 | $base base 218 | $skin skin 219 | $frame frame1 220 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipcount.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Counter QuickC program 21 | By Jim Dose' 9/13/96 22 | */ 23 | 24 | float COUNTER_TOGGLE = 1; 25 | float COUNTER_LOOP = 2; 26 | float COUNTER_STEP = 4; 27 | float COUNTER_RESET = 8; 28 | float COUNTER_RANDOM = 16; 29 | float COUNTER_FINISHCOUNT = 32; 30 | float COUNTER_START_ON = 64; 31 | 32 | void() counter_on_use; 33 | void() counter_off_use; 34 | 35 | void() counter_think = 36 | { 37 | self.cnt = self.cnt + 1; 38 | if ( self.spawnflags & COUNTER_RANDOM ) 39 | { 40 | self.state = random() * self.count; 41 | self.state = floor( self.state ) + 1; 42 | } 43 | else 44 | { 45 | self.state = self.cnt; 46 | } 47 | 48 | activator = other; 49 | SUB_UseTargets(); 50 | self.nextthink = time + self.wait; 51 | 52 | if ( self.spawnflags & COUNTER_STEP ) 53 | { 54 | counter_on_use(); 55 | } 56 | 57 | if ( self.cnt >= self.count ) 58 | { 59 | self.cnt = 0; 60 | if ( ( self.aflag ) || !( self.spawnflags & COUNTER_LOOP ) ) 61 | { 62 | if (self.spawnflags & COUNTER_TOGGLE) 63 | { 64 | counter_on_use(); 65 | } 66 | else 67 | { 68 | remove (self); 69 | } 70 | } 71 | } 72 | }; 73 | 74 | void() counter_on_use = 75 | { 76 | if ( ( self.cnt != 0 ) && ( self.spawnflags & COUNTER_FINISHCOUNT ) ) 77 | { 78 | self.aflag = TRUE; 79 | return; 80 | } 81 | 82 | self.use = counter_off_use; 83 | self.think = SUB_Null; 84 | self.aflag = FALSE; 85 | }; 86 | 87 | void() counter_off_use = 88 | { 89 | self.aflag = FALSE; 90 | if (self.spawnflags & COUNTER_TOGGLE) 91 | { 92 | self.use = counter_on_use; 93 | } 94 | else 95 | { 96 | self.use = SUB_Null; 97 | } 98 | 99 | if ( self.spawnflags & COUNTER_RESET ) 100 | { 101 | self.cnt = 0; 102 | self.state = 0; 103 | } 104 | self.think = counter_think; 105 | if (self.delay) 106 | { 107 | self.nextthink = time + self.delay; 108 | } 109 | else 110 | { 111 | counter_think(); 112 | } 113 | }; 114 | 115 | float( entity counter ) counter_GetCount = 116 | { 117 | local float value; 118 | 119 | if ( counter.classname == "counter" ) 120 | { 121 | return counter.state; 122 | } 123 | return 0; 124 | }; 125 | 126 | /*QUAKED func_counter (0 0 0.5) (0 0 0) (32 32 32) TOGGLE LOOP STEP RESET RANDOM FINISHCOUNT START_ON 127 | TOGGLE causes the counter to switch between an on and off state 128 | each time the counter is triggered. 129 | 130 | LOOP causes the counter to repeat infinitly. The count resets to zero 131 | after reaching the value in "count". 132 | 133 | STEP causes the counter to only increment when triggered. Effectively, 134 | this turns the counter into a relay with counting abilities. 135 | 136 | RESET causes the counter to reset to 0 when restarted. 137 | 138 | RANDOM causes the counter to generate random values in the range 1 to "count" 139 | at the specified interval. 140 | 141 | FINISHCOUNT causes the counter to continue counting until it reaches "count" 142 | before shutting down even after being set to an off state. 143 | 144 | START_ON causes the counter to be on when the level starts. 145 | 146 | "count" specifies how many times to repeat the event. If LOOP is set, 147 | it specifies how high to count before reseting to zero. Default is 10. 148 | 149 | "wait" the length of time between each trigger event. Default is 1 second. 150 | 151 | "delay" how much time to wait before firing after being switched on. 152 | */ 153 | 154 | void() func_counter = 155 | { 156 | if ( !self.wait ) 157 | { 158 | self.wait = 1; 159 | } 160 | 161 | self.count = floor( self.count ); 162 | if ( self.count <= 0 ) 163 | { 164 | self.count = 10; 165 | } 166 | self.cnt = 0; 167 | self.state = 0; 168 | 169 | self.classname = "counter"; 170 | self.use = counter_off_use; 171 | self.think = SUB_Null; 172 | if ( self.spawnflags & COUNTER_START_ON ) 173 | { 174 | self.think = counter_off_use; 175 | self.nextthink = time + 0.1; 176 | } 177 | }; 178 | 179 | void() oncount_use = 180 | { 181 | if ( counter_GetCount( other ) == self.count ) 182 | { 183 | activator = other; 184 | SUB_UseTargets(); 185 | } 186 | }; 187 | 188 | /*QUAKED func_oncount (0 0 0.5) (0 0 0) (16 16 16) 189 | Must be used as the target for func_counter. When the counter 190 | reaches the value set by count, func_oncount triggers its targets. 191 | 192 | "count" specifies the value to trigger on. Default is 1. 193 | 194 | "delay" how much time to wait before firing after being triggered. 195 | */ 196 | 197 | void() func_oncount = 198 | { 199 | self.count = floor( self.count ); 200 | if ( self.count <= 0 ) 201 | { 202 | self.count = 1; 203 | } 204 | 205 | self.classname = "oncount"; 206 | self.use = oncount_use; 207 | self.think = SUB_Null; 208 | }; 209 | -------------------------------------------------------------------------------- /quakec_hipnotic/hipdecoy.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | ============================================================================== 22 | 23 | PLAYER decoy 24 | 25 | ============================================================================== 26 | */ 27 | 28 | $cd id1/models/player_4 29 | $origin 0 -6 24 30 | $base base 31 | $skin skin 32 | 33 | // 34 | // running 35 | // 36 | $frame axrun1 axrun2 axrun3 axrun4 axrun5 axrun6 37 | 38 | $frame rockrun1 rockrun2 rockrun3 rockrun4 rockrun5 rockrun6 39 | 40 | // 41 | // standing 42 | // 43 | $frame stand1 stand2 stand3 stand4 stand5 44 | 45 | $frame axstnd1 axstnd2 axstnd3 axstnd4 axstnd5 axstnd6 46 | $frame axstnd7 axstnd8 axstnd9 axstnd10 axstnd11 axstnd12 47 | 48 | 49 | void() decoy_stand1 =[ $axstnd1, decoy_stand1 ] 50 | { 51 | ChangeYaw(); 52 | if (self.walkframe >= 5) 53 | self.walkframe = 0; 54 | self.frame = $stand1 + self.walkframe; 55 | self.walkframe = self.walkframe + 1; 56 | if (time > self.pausetime) 57 | self.th_walk (); 58 | }; 59 | 60 | void() decoy_walk1 =[ $rockrun1, decoy_walk1 ] 61 | { 62 | // local vector a; 63 | movetogoal (12); 64 | // a = '0 0 0'; 65 | // a_y = self.ideal_yaw; 66 | // makevectors(a); 67 | // self.velocity = 1*v_forward; 68 | self.weaponframe=0; 69 | if (self.walkframe == 6) 70 | self.walkframe = 0; 71 | if (self.walkframe == 2 || self.walkframe == 5) 72 | { 73 | local float r; 74 | r = random(); 75 | if (r < 0.14) 76 | sound (self, CHAN_VOICE, "misc/foot1.wav", 0.5, ATTN_NORM); 77 | else if (r < 0.29) 78 | sound (self, CHAN_VOICE, "misc/foot2.wav", 0.5, ATTN_NORM); 79 | else if (r < 0.43) 80 | sound (self, CHAN_VOICE, "misc/foot3.wav", 0.5, ATTN_NORM); 81 | else if (r < 0.58) 82 | sound (self, CHAN_VOICE, "misc/foot4.wav", 0.5, ATTN_NORM); 83 | else if (r < 0.72) 84 | sound (self, CHAN_VOICE, "misc/foot5.wav", 0.5, ATTN_NORM); 85 | else if (r < 0.86) 86 | sound (self, CHAN_VOICE, "misc/foot6.wav", 0.5, ATTN_NORM); 87 | else 88 | sound (self, CHAN_VOICE, "misc/foot7.wav", 0.5, ATTN_NORM); 89 | } 90 | self.frame = self.frame + self.walkframe; 91 | self.walkframe = self.walkframe + 1; 92 | }; 93 | 94 | void(entity decoy) setup_decoy = 95 | { 96 | local entity pl; 97 | 98 | decoy.classname = "monster_decoy"; 99 | setmodel (decoy, "progs/player.mdl"); 100 | setsize (decoy, VEC_HULL_MIN, VEC_HULL_MAX); 101 | decoy.view_ofs = '0 0 22'; 102 | 103 | decoy.solid = SOLID_SLIDEBOX; 104 | decoy.movetype = MOVETYPE_STEP; 105 | 106 | decoy.health = 3000000; 107 | 108 | decoy.th_stand = decoy_stand1; 109 | decoy.th_walk = decoy_walk1; 110 | decoy.th_run = decoy_walk1; 111 | decoy.th_missile = decoy_stand1; 112 | decoy.th_pain = decoy_stand1; 113 | decoy.th_die = decoy_stand1; 114 | 115 | pl = find (world, classname, "player"); 116 | decoy.colormap = pl.colormap; 117 | }; 118 | 119 | /*QUAKED monster_decoy (1 0 0) (-16 -16 -24) (16 16 40) 120 | */ 121 | void() monster_decoy = 122 | { 123 | if (deathmatch) 124 | { 125 | remove(self); 126 | return; 127 | } 128 | setup_decoy(self); 129 | 130 | walkmonster_start (); 131 | total_monsters = total_monsters - 1; 132 | }; 133 | 134 | void(string targ, vector orig) become_decoy = 135 | { 136 | local entity pl; 137 | local entity decoy; 138 | local entity temp; 139 | 140 | decoy = hipdecoy = spawn(); 141 | 142 | temp = self; 143 | self = decoy; 144 | 145 | setup_decoy(decoy); 146 | 147 | setorigin(decoy, orig); 148 | 149 | decoy.origin = orig; 150 | 151 | decoy.target = targ; 152 | 153 | decoy.takedamage = DAMAGE_AIM; 154 | 155 | decoy.ideal_yaw = decoy.angles * '0 1 0'; 156 | if (!decoy.yaw_speed) 157 | decoy.yaw_speed = 20; 158 | decoy.use = monster_use; 159 | 160 | decoy.flags = decoy.flags | FL_MONSTER; 161 | 162 | if (decoy.target) 163 | { 164 | decoy.goalentity = decoy.movetarget = find(world, targetname, decoy.target); 165 | decoy.ideal_yaw = vectoyaw(decoy.goalentity.origin - decoy.origin); 166 | if (!decoy.movetarget) 167 | { 168 | dprint ("Monster can't find target at "); 169 | dprint (vtos(decoy.origin)); 170 | dprint ("\n"); 171 | } 172 | // this used to be an objerror 173 | if (decoy.movetarget.classname == "path_corner") 174 | decoy.th_walk (); 175 | else 176 | decoy.pausetime = 99999999; 177 | decoy.th_stand (); 178 | } 179 | else 180 | { 181 | decoy.pausetime = 99999999; 182 | decoy.th_stand (); 183 | } 184 | 185 | // spread think times so they don't all happen at same time 186 | decoy.nextthink = decoy.nextthink + random()*0.5; 187 | self = temp; 188 | }; 189 | -------------------------------------------------------------------------------- /quakec_rogue/lightnin.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // lightning trail 21 | // pmack 22 | // sept 96 23 | 24 | // float ltrailLastUsed; -- now an entity field. 25 | 26 | float LT_TOGGLE = 1; 27 | float LT_ACTIVE = 2; 28 | 29 | void() ltrail_chain = 30 | { 31 | SUB_UseTargets(); 32 | 33 | self.think = SUB_Null; 34 | }; 35 | 36 | void() ltrail_fire = 37 | { 38 | local entity myTarget; 39 | 40 | if (self.classname != "ltrail_end") 41 | { 42 | sound (self, CHAN_VOICE, "weapons/lhit.wav", 1, ATTN_NORM); 43 | myTarget = find(world, targetname, self.target); 44 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 45 | WriteByte (MSG_BROADCAST, TE_LIGHTNING2); 46 | WriteEntity (MSG_BROADCAST, self); 47 | WriteCoord (MSG_BROADCAST, self.origin_x); 48 | WriteCoord (MSG_BROADCAST, self.origin_y); 49 | WriteCoord (MSG_BROADCAST, self.origin_z); 50 | WriteCoord (MSG_BROADCAST, myTarget.origin_x); 51 | WriteCoord (MSG_BROADCAST, myTarget.origin_y); 52 | WriteCoord (MSG_BROADCAST, myTarget.origin_z); 53 | LightningDamage (self.origin, myTarget.origin, self, self.currentammo); 54 | } 55 | 56 | if ( self.items < time) 57 | { 58 | self.think = ltrail_chain; 59 | self.nextthink = time + self.frags; 60 | } 61 | else 62 | { 63 | self.think = ltrail_fire; 64 | self.nextthink = time + 0.05; 65 | } 66 | }; 67 | 68 | void() ltrail_start_fire = 69 | { 70 | // if it's a toggle ltrail, we ignore triggers from ltrail_end's 71 | // when toggled off. 72 | if (self.spawnflags & LT_TOGGLE) 73 | { 74 | // user is not a lightning trail - change activity state. 75 | if ( other.classname != "ltrail_end" ) 76 | { 77 | if (self.spawnflags & LT_ACTIVE) 78 | // currently active 79 | { 80 | self.spawnflags = self.spawnflags - LT_ACTIVE; 81 | return; 82 | } 83 | else 84 | // not active 85 | { 86 | self.spawnflags = self.spawnflags + LT_ACTIVE; 87 | } 88 | } 89 | // user is lightning trail, but trail has been turned off. 90 | // ignore the message. 91 | else if (!(self.spawnflags & LT_ACTIVE)) 92 | return; 93 | } 94 | 95 | if (self.classname == "ltrail_start") 96 | { 97 | self.items = time + self.weapon; 98 | ltrail_fire(); 99 | self.ltrailLastUsed = time; 100 | } 101 | else if (self.classname == "ltrail_relay") 102 | { 103 | self.items = time + self.weapon; 104 | ltrail_fire(); 105 | } 106 | else 107 | { 108 | self.think = ltrail_chain; 109 | self.nextthink = time + self.frags; 110 | } 111 | }; 112 | 113 | /*QUAKED ltrail_start (0 1 0) (-8 -8 -8) (8 8 8) LT_TOGGLE 114 | Starting point of a lightning trail. 115 | Set currentammo to amount of damage you want the lightning to do. 116 | Default is 25. 117 | 118 | Set frags to amount of time before next item is triggered. 119 | Default is 0.3 seconds. 120 | 121 | Set weapon to amount of time to be firing the lightning. 122 | Default is 0.3 seconds. 123 | 124 | Set the LT_TOGGLE checkbox if you want the lightning shooter to continuously fire until triggered again. 125 | */ 126 | void() ltrail_start = 127 | { 128 | self.ltrailLastUsed = time; 129 | 130 | precache_sound ("weapons/lhit.wav"); 131 | self.movetype = MOVETYPE_NONE; 132 | self.solid = SOLID_BBOX; 133 | self.use = ltrail_start_fire; 134 | 135 | if (self.currentammo == 0) 136 | self.currentammo = 25; 137 | 138 | if (self.weapon == 0) 139 | self.weapon = 0.3; 140 | 141 | if (self.frags == 0) 142 | self.frags = 0.3; 143 | 144 | if (self.spawnflags & LT_ACTIVE) 145 | { 146 | self.items = time + 99999999; 147 | self.think = ltrail_fire; 148 | self.nextthink = time + 0.1; 149 | } 150 | }; 151 | 152 | /*QUAKED ltrail_relay (0 1 0) (-8 -8 -8) (8 8 8) 153 | Relay point of a lightning trail. 154 | Set currentammo to amount of damage you want the lightning to do. 155 | Default is 25. 156 | 157 | Set frags to amount of time before next item is triggered. 158 | Default is 0.3 seconds. 159 | 160 | Set weapon to amount of time to be firing the lightning. 161 | Default is 0.3 seconds. 162 | */ 163 | void() ltrail_relay = 164 | { 165 | precache_sound ("weapons/lhit.wav"); 166 | self.movetype = MOVETYPE_NONE; 167 | self.solid = SOLID_BBOX; 168 | self.use = ltrail_start_fire; 169 | 170 | if (self.currentammo == 0) 171 | self.currentammo = 25; 172 | 173 | if (self.weapon == 0) 174 | self.weapon = 0.3; 175 | 176 | if (self.frags == 0) 177 | self.frags = 0.3; 178 | }; 179 | 180 | /*QUAKED ltrail_end (0 1 0) (-8 -8 -8) (8 8 8) 181 | Ending point of a lightning trail. 182 | Does not fire any lightning. 183 | 184 | Set frags to amount of time before next item is triggered. 185 | Default is 0.3 seconds. 186 | */ 187 | void() ltrail_end = 188 | { 189 | precache_sound ("weapons/lhit.wav"); 190 | self.movetype = MOVETYPE_NONE; 191 | self.solid = SOLID_BBOX; 192 | self.use = ltrail_start_fire; 193 | 194 | if (self.currentammo == 0) 195 | self.currentammo = 25; 196 | 197 | if (self.weapon == 0) 198 | self.weapon = 0.3; 199 | 200 | if (self.frags == 0) 201 | self.frags = 0.3; 202 | }; 203 | -------------------------------------------------------------------------------- /quakec_rogue/dmatch.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // dmatch - general deathmatch additions 21 | 22 | // ======================================= 23 | // ======================================= 24 | void() tag_token_respawn = 25 | { 26 | local entity spawnPoint; 27 | local entity tagToken; 28 | 29 | tagToken = find (world, classname, "dmatch_tag_token"); 30 | if(tagToken == world) 31 | return; 32 | 33 | spawnPoint = SelectSpawnPoint(); 34 | setorigin(tagToken, spawnPoint.origin); 35 | tag_token_owner = world; 36 | tagToken.solid = SOLID_TRIGGER; 37 | tagToken.touch = tag_token_touch; 38 | tagToken.think = SUB_Null; 39 | tagToken.owner = world; 40 | tagToken.tag_frags = 0; 41 | droptofloor(); 42 | }; 43 | 44 | // ======================================= 45 | // ======================================= 46 | void() tag_token_fall = 47 | { 48 | self.tag_frags = 0; 49 | self.think = tag_token_respawn; 50 | self.nextthink = time + 30; 51 | droptofloor(); 52 | }; 53 | 54 | // ======================================= 55 | // ======================================= 56 | void() tag_token_drop = 57 | { 58 | local entity tagToken; 59 | 60 | tagToken = find (world, classname, "dmatch_tag_token"); 61 | if(tagToken == world) 62 | return; 63 | 64 | bprint("$qc_lost_token", tagToken.owner.netname); 65 | tagToken.tag_frags = 0; 66 | tagToken.solid = SOLID_TRIGGER; 67 | tagToken.owner = world; 68 | tagToken.touch = tag_token_touch; 69 | tagToken.think = tag_token_fall; 70 | tagToken.nextthink = time + 0.1; 71 | }; 72 | 73 | // ======================================= 74 | // ======================================= 75 | void() tag_token_think = 76 | { 77 | if ( self.owner.health > 0) 78 | { 79 | if ( self.tag_message_time < time ) 80 | { 81 | bprint("$qc_has_token", self.owner.netname); 82 | self.tag_message_time = time + 30; 83 | } 84 | 85 | setorigin ( self, self.owner.origin + '0 0 48'); 86 | self.think = tag_token_think; 87 | self.nextthink = time + 0.1; 88 | } 89 | else 90 | { 91 | tag_token_drop(); 92 | } 93 | }; 94 | 95 | // ======================================= 96 | // ======================================= 97 | void() tag_token_touch = 98 | { 99 | if (other.classname != "player") 100 | return; 101 | 102 | tag_token_owner = other; 103 | self.tag_frags = 0; 104 | 105 | sound ( self, CHAN_AUTO, "runes/end1.wav", 1, ATTN_NORM); 106 | 107 | bprint("$qc_got_token", other.netname); 108 | self.tag_message_time = time + 30; 109 | 110 | self.owner = other; 111 | self.solid = SOLID_NOT; 112 | self.touch = SUB_Null; 113 | self.think = tag_token_think; 114 | self.nextthink = time + 0.1; 115 | }; 116 | 117 | /*QUAKED dmatch_tag_token (1 1 0) (-16 -16 -16) (16 16 16) 118 | The deathmatch tag token. 119 | */ 120 | void() dmatch_tag_token = 121 | { 122 | if ( cvar("teamplay") != TEAM_DMATCH_TAG ) 123 | { 124 | remove (self); 125 | return; 126 | } 127 | 128 | precache_model ("progs/sphere.mdl"); 129 | precache_sound ("runes/end1.wav"); 130 | setmodel(self, "progs/sphere.mdl"); 131 | self.skin = 1; 132 | setsize (self, '-16 -16 -16', '16 16 16'); 133 | self.touch = tag_token_touch; 134 | self.effects = self.effects | EF_DIMLIGHT; 135 | StartItem(); 136 | }; 137 | 138 | // ======================================= 139 | // ======================================= 140 | void(entity targ, entity attacker) dmatch_score = 141 | { 142 | local entity tagToken; 143 | 144 | if ( teamplay == TEAM_DMATCH_TAG ) 145 | { 146 | tagToken = find (world, classname, "dmatch_tag_token"); 147 | if(tagToken == world) 148 | { 149 | attacker.frags = attacker.frags + 1; 150 | return; 151 | } 152 | 153 | if ( attacker == tag_token_owner) 154 | { 155 | tagToken.tag_frags = tagToken.tag_frags + 1; 156 | attacker.frags = attacker.frags + 3; 157 | if ( tagToken.tag_frags == 5 ) 158 | { 159 | sprint (attacker, "$qc_got_quad"); 160 | attacker.items = attacker.items | IT_QUAD; 161 | stuffcmd (attacker, "bf\n"); 162 | sound (attacker,CHAN_VOICE,"items/damage.wav", 1, ATTN_NORM); 163 | attacker.super_time = 1; 164 | attacker.super_damage_finished = time + 30; 165 | } 166 | else if (tagToken.tag_frags == 10) 167 | { 168 | bprint("$qc_lost_token", attacker.netname); 169 | tagToken.solid = SOLID_TRIGGER; 170 | tagToken.tag_frags = 0; 171 | tagToken.touch = tag_token_touch; 172 | tag_token_respawn(); 173 | } 174 | } 175 | else 176 | { 177 | if (targ == tag_token_owner) 178 | { 179 | attacker.frags = attacker.frags + 5; 180 | sound ( self, CHAN_AUTO, "runes/end1.wav", 1, ATTN_NORM); 181 | if (attacker.classname == "player") 182 | { 183 | tag_token_owner = attacker; 184 | 185 | tagToken.tag_frags = 0; 186 | tagToken.tag_message_time = time + 0.5; 187 | tagToken.owner = attacker; 188 | tagToken.solid = SOLID_NOT; 189 | tagToken.touch = SUB_Null; 190 | tagToken.think = tag_token_think; 191 | tagToken.nextthink = time + 0.1; 192 | } 193 | } 194 | else 195 | attacker.frags = attacker.frags + 1; 196 | } 197 | } 198 | }; 199 | 200 | 201 | -------------------------------------------------------------------------------- /quakec_mg1/rotate.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | =============================================================================== 22 | Bmodel rotation 23 | =============================================================================== 24 | */ 25 | 26 | vector ModAngles(vector a) 27 | { 28 | while(a_x > 360) a_x -= 360; 29 | while(a_x < 0) a_x += 360; 30 | while(a_y > 360) a_y -= 360; 31 | while(a_y < 0) a_y += 360; 32 | while(a_z > 360) a_z -= 360; 33 | while(a_x < 0) a_z += 360; 34 | return a; 35 | } 36 | 37 | float Clamp(float v, float min, float max) 38 | { 39 | if(v < min) return min; 40 | if(v > max) return max; 41 | return v; 42 | } 43 | 44 | /*QUAKED info_rotate (0.4 1.0 0.6) (-8 -8 -8) (8 8 8) 45 | Used to indicate center of rotation. 46 | */ 47 | void info_rotate_axis() 48 | { 49 | remove(self); 50 | } 51 | 52 | /* 53 | =============================================================================== 54 | Continuous rotation 55 | self.state = state: either off, on, accel up, or deccel down. 56 | self.avelocity = rotation degrees per second 57 | self.speed = current fraction of angluar velocity 58 | self.distance = change in self.speed per second, negative if decelerating 59 | self.delay = editor field for how long the acceleration should take 60 | =============================================================================== 61 | */ 62 | 63 | enum : int 64 | { 65 | RotateStateOff, 66 | RotateStateAccelUp, 67 | RotateStateOn, 68 | RotateStateDecelDown 69 | }; 70 | 71 | void rotate_object_continuously_tick(float DeltaTime) 72 | { 73 | self.angles = ModAngles(self.angles + self.avelocity * DeltaTime); 74 | } 75 | 76 | void rotate_object_tween_tick(float DeltaTime) 77 | { 78 | self.speed += self.distance * DeltaTime; 79 | self.speed = Clamp(self.speed, 0, 1); 80 | if(self.speed == 0) 81 | { 82 | self.state = RotateStateOff; 83 | RemoveFrameTickEntity(self); 84 | return; 85 | } 86 | if(self.speed == 1) 87 | { 88 | self.state = RotateStateOn; 89 | self.tick = rotate_object_continuously_tick; 90 | self.tick(DeltaTime); 91 | 92 | return; 93 | } 94 | self.angles = ModAngles(self.angles + self.avelocity * DeltaTime * self.speed); 95 | } 96 | 97 | void rotate_object_continuously_use() 98 | { 99 | if(self.delay <= 0) 100 | { 101 | //No acceleration, just toggle on or off 102 | if(self.state == RotateStateOff) 103 | { 104 | self.state = RotateStateOn; 105 | RegisterFrameTickEntity(self); 106 | } 107 | else 108 | { 109 | self.state = RotateStateOff; 110 | RemoveFrameTickEntity(self); 111 | } 112 | return; 113 | } 114 | 115 | switch(self.state) 116 | { 117 | case RotateStateOff: 118 | self.state = RotateStateAccelUp; 119 | self.tick = rotate_object_tween_tick; 120 | self.distance = fabs(self.distance); 121 | RegisterFrameTickEntity(self); 122 | return; 123 | 124 | case RotateStateAccelUp: 125 | self.state = RotateStateDecelDown; 126 | self.tick = rotate_object_tween_tick; 127 | self.distance = -fabs(self.distance); 128 | return; 129 | 130 | case RotateStateOn: 131 | self.state = RotateStateDecelDown; 132 | self.tick = rotate_object_tween_tick; 133 | self.distance = -fabs(self.distance); 134 | return; 135 | 136 | case RotateStateDecelDown: 137 | self.state = RotateStateAccelUp; 138 | self.tick = rotate_object_tween_tick; 139 | self.distance = fabs(self.distance); 140 | return; 141 | } 142 | } 143 | 144 | /*QUAKED rotate_object_continuously (0.4 1.0 0.6) (? ? ?) (? ? ?) START_OFF 145 | Non-solid object that rotates continuously. 146 | Trigger to turn on and off. 147 | */ 148 | void rotate_object_continuously() 149 | { 150 | if(!self.avelocity) 151 | { 152 | self.avelocity = '0 30 0'; 153 | } 154 | if(self.delay > 0) 155 | { 156 | self.distance = 1 / self.delay; 157 | } 158 | 159 | if(self.spawnflags & SOLID_BSP) 160 | { 161 | self.movetype = MOVETYPE_PUSH; 162 | self.solid = SOLID_BSP; 163 | } 164 | else 165 | { 166 | self.movetype = MOVETYPE_NONE; 167 | self.solid = SOLID_NOT; 168 | } 169 | self.angles = '0 0 0'; 170 | if(self.pos2) 171 | { 172 | self.origin = self.pos2; 173 | setorigin(self, self.origin); 174 | } 175 | setmodel(self, self.model); 176 | 177 | self.use = rotate_object_continuously_use; 178 | self.tick = rotate_object_continuously_tick; 179 | 180 | if(self.spawnflags & START_OFF) 181 | { 182 | self.state = RotateStateOff; 183 | } 184 | else 185 | { 186 | self.state = RotateStateOn; 187 | self.speed = 1; 188 | RegisterFrameTickEntity(self); 189 | } 190 | } 191 | 192 | /* 193 | =============================================================================== 194 | Accel/decel rotation 195 | =============================================================================== 196 | */ 197 | 198 | 199 | -------------------------------------------------------------------------------- /quakec_rogue/lava_wpn.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | // LAVA Weapon Routines 21 | 22 | /* 23 | =============== 24 | launch_lava_spike 25 | 26 | Used for both the player and the ogre 27 | =============== 28 | */ 29 | void(vector org, vector dir) launch_lava_spike = 30 | { 31 | newmis = spawn (); 32 | newmis.owner = self; 33 | newmis.movetype = MOVETYPE_FLYMISSILE; 34 | newmis.solid = SOLID_BBOX; 35 | 36 | newmis.angles = vectoangles(dir); 37 | 38 | newmis.touch = lavaspike_touch; 39 | newmis.classname = "lava_spike"; 40 | newmis.think = SUB_Remove; 41 | newmis.nextthink = time + 6; 42 | setmodel (newmis, "progs/lspike.mdl"); 43 | setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); 44 | setorigin (newmis, org); 45 | 46 | newmis.velocity = dir * 1000; 47 | }; 48 | 49 | void() W_FireSuperLavaSpikes = 50 | { 51 | local vector dir; 52 | local entity old; 53 | 54 | sound (self, CHAN_WEAPON, "weapons/spike2.wav", 1, ATTN_NORM); 55 | self.attack_finished = time + 0.2; 56 | self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 2; 57 | UpdateAmmoCounts (self); 58 | 59 | dir = aim (self, 1000); 60 | launch_lava_spike (self.origin + '0 0 16', dir); 61 | newmis.touch = superlavaspike_touch; 62 | 63 | // setmodel (newmis, "progs/lspike.mdl"); 64 | 65 | setsize (newmis, VEC_ORIGIN, VEC_ORIGIN); 66 | self.punchangle_x = -2; 67 | }; 68 | 69 | void(float ox) W_FireLavaSpikes = 70 | { 71 | local vector dir; 72 | local entity old; 73 | 74 | makevectors (self.v_angle); 75 | 76 | if (self.ammo_lava_nails >= 2 && self.weapon == IT_LAVA_SUPER_NAILGUN) 77 | { 78 | W_FireSuperLavaSpikes (); 79 | return; 80 | } 81 | 82 | if (self.ammo_lava_nails < 1) 83 | { 84 | sprint (self, "$qc_out_lava_nails"); 85 | self.weapon = W_BestWeapon (); 86 | W_SetCurrentAmmo (); 87 | return; 88 | } 89 | 90 | sound (self, CHAN_WEAPON, "weapons/rocket1i.wav", 1, ATTN_NORM); 91 | self.attack_finished = time + 0.2; 92 | self.currentammo = self.ammo_lava_nails = self.ammo_lava_nails - 1; 93 | UpdateAmmoCounts (self); 94 | 95 | dir = aim (self, 1000); 96 | launch_lava_spike (self.origin + '0 0 16' + v_right*ox, dir); 97 | 98 | self.punchangle_x = -2; 99 | }; 100 | 101 | // =============== Lava Spike Touch Routines 102 | 103 | void() lavaspike_touch = 104 | { 105 | local float rand; 106 | local float old_armortype; 107 | local float old_armorvalue; 108 | local float old_armormask; 109 | 110 | if (other == self.owner) 111 | return; 112 | 113 | if (other.solid == SOLID_TRIGGER) 114 | return; // trigger field, do nothing 115 | 116 | if (pointcontents(self.origin) == CONTENT_SKY) 117 | { 118 | remove(self); 119 | return; 120 | } 121 | 122 | // hit something that bleeds 123 | if (other.takedamage) 124 | { 125 | spawn_touchblood (9); 126 | if(other.classname == "player") 127 | { 128 | old_armortype = other.armortype; 129 | old_armorvalue = other.armorvalue; 130 | old_armormask = other.items2 & (IT2_ARMOR1|IT2_ARMOR2|IT2_ARMOR3); 131 | other.armortype = 0; 132 | other.armorvalue = 0; 133 | T_Damage (other, self, self.owner, 9); 134 | other.armortype = old_armortype; 135 | other.armorvalue = old_armorvalue; 136 | other.items2 = other.items2 | old_armormask; 137 | } 138 | else // is a monster 139 | { 140 | if ( other.classname != "monster_lava_man") 141 | { 142 | T_Damage (other, self, self.owner, 15); 143 | } 144 | } 145 | } 146 | else 147 | { 148 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 149 | 150 | if (self.classname == "wizspike") 151 | WriteByte (MSG_BROADCAST, TE_WIZSPIKE); 152 | else if (self.classname == "knightspike") 153 | WriteByte (MSG_BROADCAST, TE_KNIGHTSPIKE); 154 | else 155 | WriteByte (MSG_BROADCAST, TE_SPIKE); 156 | WriteCoord (MSG_BROADCAST, self.origin_x); 157 | WriteCoord (MSG_BROADCAST, self.origin_y); 158 | WriteCoord (MSG_BROADCAST, self.origin_z); 159 | } 160 | 161 | remove(self); 162 | 163 | }; 164 | 165 | void() superlavaspike_touch = 166 | { 167 | local float rand; 168 | local float old_armortype; 169 | //local float old_armorvalue; 170 | 171 | if (other == self.owner) 172 | return; 173 | 174 | if (other.solid == SOLID_TRIGGER) 175 | return; // trigger field, do nothing 176 | 177 | if (pointcontents(self.origin) == CONTENT_SKY) 178 | { 179 | remove(self); 180 | return; 181 | } 182 | 183 | // hit something that bleeds 184 | if (other.takedamage) 185 | { 186 | spawn_touchblood (18); 187 | 188 | // halve the effectiveness of the armor for players.. 189 | if(other.classname == "player") 190 | { 191 | // save the old armor values... 192 | old_armortype = other.armortype; 193 | // old_armorvalue = other.armorvalue; 194 | other.armortype = other.armortype * 0.5; 195 | // other.armorvalue = 0; 196 | T_Damage (other, self, self.owner, 18); 197 | 198 | // if the damage didn't wipe out the armor, armortype 199 | if(other.armortype != 0) 200 | { 201 | other.armortype = old_armortype; 202 | // other.armorvalue = old_armorvalue; 203 | } 204 | } 205 | else // is a monster, do 50% more damage 206 | { 207 | if ( other.classname != "monster_lava_man") 208 | { 209 | T_Damage (other, self, self.owner, 30); 210 | } 211 | } 212 | } 213 | else 214 | { 215 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 216 | WriteByte (MSG_BROADCAST, TE_SUPERSPIKE); 217 | WriteCoord (MSG_BROADCAST, self.origin_x); 218 | WriteCoord (MSG_BROADCAST, self.origin_y); 219 | WriteCoord (MSG_BROADCAST, self.origin_z); 220 | } 221 | 222 | remove(self); 223 | 224 | }; 225 | -------------------------------------------------------------------------------- /quakec_mg1/items_runes.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* 21 | =============================================================================== 22 | 23 | END OF LEVEL RUNES 24 | 25 | =============================================================================== 26 | */ 27 | 28 | float SIGIL_E1 = 1; 29 | float SIGIL_E2 = 2; 30 | float SIGIL_E3 = 4; 31 | float SIGIL_E4 = 8; 32 | float SIGIL_E5 = 16; 33 | float SIGIL_E6 = 32; 34 | float SIGIL_NUMBITS = 6; 35 | 36 | float SIGIL_ALL = SIGIL_E1 | SIGIL_E2 | SIGIL_E3 | SIGIL_E4 | SIGIL_E5; 37 | float SIGIL_ALL_ALL_ALLLL = SIGIL_E1 | SIGIL_E2 | SIGIL_E3 | SIGIL_E4 | SIGIL_E5 | SIGIL_E6; 38 | 39 | 40 | void() sigil_touch = 41 | { 42 | if (other.classname != "player") 43 | return; 44 | if (other.health <= 0) 45 | return; 46 | 47 | centerprint_all (self.netname); // Netname is localized 48 | 49 | sound (other, CHAN_ITEM, self.noise, 1, ATTN_NORM); 50 | stuffcmd (other, "bf\n"); 51 | self.solid = SOLID_NOT; 52 | self.model = string_null; 53 | float lastPickup = SUB_LeftShift(self.spawnflags & SIGIL_ALL, SIGIL_NUMBITS); 54 | serverflags = serverflags | (self.spawnflags & SIGIL_ALL) | lastPickup; 55 | 56 | if (cvar("horde") && (self.spawnflags & SIGIL_E2)) // Hunger 57 | { 58 | local entity e; 59 | e = find(world, classname, "player"); 60 | while (e) 61 | { 62 | e.hunger_time = time + HUNGER_MAX; 63 | dprint("hunger time is: "); 64 | dprint(ftos(e.hunger_time)); 65 | dprint("\n"); 66 | e = find(e, classname, "player"); 67 | } 68 | } 69 | 70 | activator = other; 71 | SUB_UseTargets(); // fire all targets / killtargets 72 | }; 73 | 74 | float sigil_getLastPickup() 75 | { 76 | float lastPickup = SUB_RightShift(serverflags, SIGIL_NUMBITS) & SIGIL_ALL; 77 | return lastPickup; 78 | } 79 | 80 | void sigil_clearLastPickup() 81 | { 82 | serverflags = serverflags & ~SUB_LeftShift(SIGIL_ALL, SIGIL_NUMBITS); 83 | } 84 | 85 | 86 | /*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4 E5 E6 87 | End of level sigil, pick up to end episode and return to jrstart. 88 | */ 89 | 90 | void() item_sigil = 91 | { 92 | dprint("SPAWNING SIGIL: "); 93 | dprint(ftos(self.spawnflags)); 94 | dprint("\n"); 95 | if (!self.spawnflags) 96 | self.spawnflags|= SIGIL_E1; 97 | 98 | precache_sound ("misc/runekey.wav"); 99 | self.noise = "misc/runekey.wav"; 100 | 101 | string tempmdl = string_null; 102 | 103 | if (self.spawnflags & SIGIL_E1) 104 | { 105 | self.spawnflags = SIGIL_E1; 106 | tempmdl = "progs/mg1_rune1.mdl"; 107 | self.netname = "$qc_mg1_pickup_rune1"; 108 | } 109 | else if (self.spawnflags & SIGIL_E2) 110 | { 111 | self.spawnflags = SIGIL_E2; 112 | tempmdl = "progs/mg1_rune2.mdl"; 113 | self.netname = "$qc_mg1_pickup_rune2"; 114 | } 115 | else if (self.spawnflags & SIGIL_E3) 116 | { 117 | self.spawnflags = SIGIL_E3; 118 | tempmdl = "progs/mg1_rune3.mdl"; 119 | self.netname = "$qc_mg1_pickup_rune3"; 120 | } 121 | else if (self.spawnflags & SIGIL_E4) 122 | { 123 | self.spawnflags = SIGIL_E4; 124 | tempmdl = "progs/mg1_rune4.mdl"; 125 | self.netname = "$qc_mg1_pickup_rune4"; 126 | } 127 | else if (self.spawnflags & SIGIL_E5) 128 | { 129 | self.spawnflags = SIGIL_E5; 130 | tempmdl = "progs/mg1_rune5.mdl"; 131 | self.netname = "$qc_mg1_pickup_rune5"; 132 | } 133 | else if (self.spawnflags & SIGIL_E6) 134 | { 135 | self.spawnflags = SIGIL_E6; 136 | tempmdl = "progs/mg1_rune6.mdl"; 137 | self.netname = "$qc_mg1_pickup_rune6"; 138 | } 139 | 140 | 141 | dprint("PREP SIGIL\n"); 142 | 143 | precache_model (tempmdl); 144 | setmodel (self, tempmdl); 145 | 146 | self.touch = sigil_touch; 147 | setsize (self, '-16 -16 -24', '16 16 32'); 148 | StartItem (); 149 | }; 150 | 151 | // =============================================================================== 152 | 153 | const float RUNE_INDICATOR_ACTIVE = 64; 154 | 155 | void misc_rune_indicator_use() 156 | { 157 | self.alpha = 1.0; 158 | SUB_UseTargets(); 159 | } 160 | 161 | void misc_rune_indicator() 162 | { 163 | float active = self.spawnflags & RUNE_INDICATOR_ACTIVE ? TRUE : FALSE; 164 | self.spawnflags (-) RUNE_INDICATOR_ACTIVE; 165 | if (!self.spawnflags) 166 | { 167 | self.spawnflags|= SIGIL_E1; 168 | } 169 | self.spawnflags &= SIGIL_ALL_ALL_ALLLL; 170 | 171 | string mdl = string_null; 172 | 173 | if (self.spawnflags & SIGIL_E1) 174 | { 175 | self.spawnflags = SIGIL_E1; 176 | mdl = "progs/mg1_rune1.mdl"; 177 | } 178 | else if (self.spawnflags & SIGIL_E2) 179 | { 180 | self.spawnflags = SIGIL_E2; 181 | mdl = "progs/mg1_rune2.mdl"; 182 | } 183 | else if (self.spawnflags & SIGIL_E3) 184 | { 185 | self.spawnflags = SIGIL_E3; 186 | mdl = "progs/mg1_rune3.mdl"; 187 | } 188 | else if (self.spawnflags & SIGIL_E4) 189 | { 190 | self.spawnflags = SIGIL_E4; 191 | mdl = "progs/mg1_rune4.mdl"; 192 | } 193 | else if (self.spawnflags & SIGIL_E5) 194 | { 195 | self.spawnflags = SIGIL_E5; 196 | mdl = "progs/mg1_rune5.mdl"; 197 | } 198 | else if (self.spawnflags & SIGIL_E6) 199 | { 200 | self.spawnflags = SIGIL_E6; 201 | mdl = "progs/mg1_rune6.mdl"; 202 | } 203 | 204 | precache_model (mdl); 205 | setmodel (self, mdl); 206 | 207 | self.use = misc_rune_indicator_use; 208 | 209 | if(((self.spawnflags & serverflags) == self.spawnflags) || active ) 210 | { 211 | self.think = SUB_UseTargets; 212 | self.nextthink = time + 0.2; 213 | } 214 | else 215 | { 216 | //Show a ghost of the rune before you collect it. 217 | self.alpha = 0.2; 218 | } 219 | } -------------------------------------------------------------------------------- /quakec_hipnotic/hiptrain.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Train QuickC program 21 | By Jim Dose' 9/11/96 22 | */ 23 | 24 | void() train_blocked; 25 | void() func_train; 26 | void() hip_train_next; 27 | void() hip_func_train_find; 28 | 29 | void() hip_train_use = 30 | { 31 | if (self.think != hip_func_train_find) 32 | { 33 | if ( self.velocity != '0 0 0' ) 34 | return; // already activated 35 | } 36 | hip_train_next(); 37 | }; 38 | 39 | void() hip_train_wait = 40 | { 41 | if (self.wait) 42 | { 43 | sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); 44 | if ( self.wait != -1 ) 45 | { 46 | self.nextthink = self.ltime + self.wait; 47 | self.wait = 0; 48 | } 49 | } 50 | else 51 | self.nextthink = self.ltime + 0.1; 52 | 53 | self.think = hip_train_next; 54 | }; 55 | 56 | 57 | void() hip_train_next = 58 | { 59 | local entity targ; 60 | local float current; 61 | local string temp; 62 | 63 | // Get the speed of the current path_corner. 64 | // (we must save this off at each path change since 65 | // we don't have a pointer to the current path_corner). 66 | current = self.cnt; 67 | 68 | targ = find (world, targetname, self.target); 69 | 70 | // Save the speed in cnt for later use 71 | self.cnt = targ.speed; 72 | self.target = targ.target; 73 | if (!self.target) 74 | objerror ("hip_train_next: no next target"); 75 | 76 | sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); 77 | 78 | self.wait = targ.wait; 79 | if (targ.wait) 80 | { 81 | self.think = hip_train_wait; 82 | } 83 | else 84 | { 85 | self.think = hip_train_next; 86 | } 87 | 88 | if ( self.goalentity.event ) 89 | { 90 | // Trigger any events that should happen at the corner. 91 | temp = self.target; 92 | self.target = self.goalentity.event; 93 | self.message = self.goalentity.message; 94 | SUB_UseTargets(); 95 | self.target = temp; 96 | self.message = string_null; 97 | } 98 | 99 | // Save the current entity 100 | self.goalentity = targ; 101 | 102 | if ( current == -1 ) 103 | { 104 | // Warp to the next path_corner 105 | setorigin (self, targ.origin - self.mins ); 106 | self.nextthink = self.ltime + 0.01; 107 | } 108 | else 109 | { 110 | // check if there's a speed change 111 | if (current>0) 112 | self.speed = current; 113 | 114 | // travel to the next path change 115 | SUB_CalcMove (targ.origin - self.mins, self.speed, self.think ); 116 | } 117 | }; 118 | 119 | void() hip_func_train_find = 120 | 121 | { 122 | local entity targ; 123 | 124 | targ = find (world, targetname, self.target); 125 | 126 | // Save the current entity 127 | self.goalentity = targ; 128 | 129 | // Save the speed in cnt for later use 130 | self.cnt = targ.speed; 131 | 132 | self.target = targ.target; 133 | setorigin (self, targ.origin - self.mins); 134 | if (!self.targetname) 135 | { // not triggered, so start immediately 136 | self.nextthink = self.ltime + 0.1; 137 | self.think = hip_train_next; 138 | } 139 | }; 140 | 141 | /*QUAKED func_train2 (0 .5 .8) ? 142 | This is a modification of the standard func_train entity. 143 | It is functionally equivalent, except that it removes a slight delay that 144 | would occur after each path entry, and it adds a speed variable to the 145 | path_corner entity. 146 | 147 | "noise" contains the name of the sound to play when train stops. 148 | "noise1" contains the name of the sound to play when train moves. 149 | Both "noise" and "noise1" defaults depend upon "sounds" variable. 150 | 151 | In path_corner, set speed to be the new speed of the train after it reaches 152 | the path change. If speed is -1, the train will warp directly to the next 153 | path change after the specified wait time. 154 | 155 | Also in path_corner, if wait is set to -1, the train will wait until it is 156 | retriggered before moving on to the next goal. 157 | 158 | Here is a reiteration of the func_train docs: 159 | 160 | Trains are moving platforms that players can ride. 161 | The targets origin specifies the min point of the train at each corner. 162 | The train spawns at the first target it is pointing at. 163 | If the train is the target of a button or trigger, it will not begin moving until activated. 164 | speed default 100 165 | dmg default 2 166 | sounds 167 | 1) ratchet metal 168 | 169 | */ 170 | void() func_train2 = 171 | { 172 | if (!self.speed) 173 | self.speed = 100; 174 | if (!self.target) 175 | objerror ("func_train without a target"); 176 | if (!self.dmg) 177 | self.dmg = 2; 178 | 179 | if ( !self.noise ) 180 | { 181 | if (self.sounds == 0) 182 | { 183 | self.noise = ("misc/null.wav"); 184 | } 185 | 186 | if (self.sounds == 1) 187 | { 188 | self.noise = ("plats/train2.wav"); 189 | } 190 | } 191 | if ( !self.noise1 ) 192 | { 193 | if (self.sounds == 0) 194 | { 195 | self.noise1 = ("misc/null.wav"); 196 | } 197 | if (self.sounds == 1) 198 | { 199 | self.noise1 = ("plats/train1.wav"); 200 | } 201 | } 202 | 203 | precache_sound( self.noise ); 204 | precache_sound( self.noise1 ); 205 | 206 | self.cnt = 1; 207 | self.solid = SOLID_BSP; 208 | self.movetype = MOVETYPE_PUSH; 209 | self.blocked = train_blocked; 210 | self.use = hip_train_use; 211 | self.classname = "train2"; 212 | 213 | setmodel (self, self.model); 214 | setsize (self, self.mins , self.maxs); 215 | setorigin (self, self.origin); 216 | 217 | // start trains on the second frame, to make sure their targets have had 218 | // a chance to spawn 219 | self.nextthink = self.ltime + 0.1; 220 | self.think = hip_func_train_find; 221 | }; 222 | -------------------------------------------------------------------------------- /quakec_hipnotic/hip_expl.qc: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996-2022 id Software LLC 2 | 3 | This program is free software; you can redistribute it and/or modify 4 | it under the terms of the GNU General Public License as published by 5 | the Free Software Foundation; either version 2 of the License, or 6 | (at your option) any later version. 7 | 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License 14 | along with this program; if not, write to the Free Software 15 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | See file, 'COPYING', for details. 18 | */ 19 | 20 | /* Exploder QuickC program 21 | By Jim Dose' 9/13/96 22 | 23 | */ 24 | 25 | float USE_PARTICLES = 1; 26 | 27 | void() BecomeExplosion; 28 | 29 | void() exploder_fire = 30 | { 31 | local entity temp; 32 | 33 | temp = self; 34 | activator = other; 35 | SUB_UseTargets (); 36 | self = temp; 37 | other = self; 38 | if (self.dmg<120) 39 | { 40 | sound (self , CHAN_AUTO, "misc/shortexp.wav", self.volume, self.speed); 41 | } 42 | else 43 | { 44 | sound (self , CHAN_AUTO, "misc/longexpl.wav", self.volume, self.speed); 45 | } 46 | T_RadiusDamage (self, self.owner, self.dmg, other); 47 | if (self.spawnflags & USE_PARTICLES) 48 | { 49 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 50 | WriteByte (MSG_BROADCAST, TE_EXPLOSION); 51 | WriteCoord (MSG_BROADCAST, self.origin_x); 52 | WriteCoord (MSG_BROADCAST, self.origin_y); 53 | WriteCoord (MSG_BROADCAST, self.origin_z); 54 | } 55 | BecomeExplosion(); 56 | }; 57 | 58 | void() exploder_use = 59 | { 60 | if (self.delay) 61 | { 62 | self.nextthink = time + self.delay; 63 | self.delay = 0; 64 | self.think = exploder_fire; 65 | } 66 | else 67 | { 68 | exploder_fire(); 69 | } 70 | }; 71 | 72 | /*QUAKED func_exploder (0.4 0 0) (0 0 0) (8 8 8) particles 73 | Spawns an explosion when triggered. Triggers any targets. 74 | 75 | "dmg" specifies how much damage to cause. Negative values 76 | indicate no damage. Default or 0 indicates 120. 77 | "volume" volume at which to play explosions (default 1.0) 78 | "speed" attenuation for explosions (default normal) 79 | */ 80 | void() func_exploder = 81 | { 82 | precache_sound ("misc/shortexp.wav"); 83 | precache_sound ("misc/longexpl.wav"); 84 | self.classname = "exploder"; 85 | self.use = exploder_use; 86 | if ( self.dmg == 0 ) 87 | { 88 | self.dmg = 120; 89 | } 90 | if ( self.dmg < 0 ) 91 | { 92 | self.dmg = 0; 93 | } 94 | if ( self.speed == 0 ) 95 | { 96 | self.speed = 1; 97 | } 98 | if ( self.volume == 0 ) 99 | { 100 | self.volume = 1.0; 101 | } 102 | }; 103 | 104 | void() multi_exploder_fire = 105 | { 106 | local entity temp; 107 | local entity expl; 108 | 109 | self.nextthink = time + self.wait; 110 | if (self.state == 0) 111 | { 112 | self.state = 1; 113 | self.duration = time + self.duration; 114 | temp = self; 115 | activator = other; 116 | SUB_UseTargets (); 117 | self = temp; 118 | other = self; 119 | } 120 | if (time > self.duration) 121 | { 122 | remove(self); 123 | return; 124 | } 125 | expl = spawn(); 126 | expl.owner = self.owner; 127 | expl.dmg = self.dmg; 128 | expl.origin_x = self.absmin_x + (random() * (self.absmax_x - self.absmin_x)); 129 | expl.origin_y = self.absmin_y + (random() * (self.absmax_y - self.absmin_y)); 130 | expl.origin_z = self.absmin_z + (random() * (self.absmax_z - self.absmin_z)); 131 | sound (expl , CHAN_VOICE, "misc/shortexp.wav", self.volume, self.speed); 132 | T_RadiusDamage (expl, self.owner, self.dmg, other); 133 | if (self.spawnflags & USE_PARTICLES) 134 | { 135 | WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); 136 | WriteByte (MSG_BROADCAST, TE_EXPLOSION); 137 | WriteCoord (MSG_BROADCAST, expl.origin_x); 138 | WriteCoord (MSG_BROADCAST, expl.origin_y); 139 | WriteCoord (MSG_BROADCAST, expl.origin_z); 140 | } 141 | temp = self; 142 | self = expl; 143 | BecomeExplosion(); 144 | self = temp; 145 | }; 146 | 147 | void( vector loc, float rad, float damage, float dur, float pause, float vol) multi_explosion = 148 | { 149 | local entity temp; 150 | 151 | temp = self; 152 | self = spawn(); 153 | self.origin = loc; 154 | self.dmg = damage; 155 | self.duration = dur; 156 | self.wait = pause; 157 | self.owner = world; 158 | self.absmin = self.origin - (rad * '1 1 1'); 159 | self.absmax = self.origin + (rad * '1 1 1'); 160 | self.think = multi_exploder_fire; 161 | self.volume = vol; 162 | multi_exploder_fire(); 163 | self = temp; 164 | }; 165 | 166 | void() multi_exploder_use = 167 | { 168 | if (self.delay) 169 | { 170 | self.nextthink = time + self.delay; 171 | self.delay = 0; 172 | self.think = multi_exploder_fire; 173 | } 174 | else 175 | { 176 | self.think = multi_exploder_fire; 177 | multi_exploder_fire(); 178 | } 179 | }; 180 | 181 | /*QUAKED func_multi_exploder (0.4 0 0) ? 182 | Spawns an explosion when triggered. Triggers any targets. 183 | size of brush determines where explosions will occur. 184 | 185 | "dmg" specifies how much damage to cause from each explosion 186 | Negative values indicate no damage. Default or 0 indicates 120. 187 | "delay" delay before exploding (Default 0 seconds) 188 | "duration" how long to explode for (Default 1 second) 189 | "wait" time between each explosion (default 0.25 seconds) 190 | "volume" volume to play explosion sound at (default 0.5) 191 | "speed" attenuation for explosions (default normal) 192 | 193 | */ 194 | void() func_multi_exploder = 195 | { 196 | precache_sound ("misc/shortexp.wav"); 197 | precache_sound ("misc/longexpl.wav"); 198 | self.classname = "exploder"; 199 | self.use = multi_exploder_use; 200 | setmodel(self,self.model); 201 | self.movetype = MOVETYPE_NONE; 202 | self.modelindex = 0; 203 | self.model = ""; 204 | if ( self.dmg == 0 ) 205 | { 206 | self.dmg = 120; 207 | } 208 | if ( self.dmg < 0 ) 209 | { 210 | self.dmg = 0; 211 | } 212 | if (self.duration == 0) 213 | self.duration = 1.0; 214 | if (self.speed == 0) 215 | self.speed = 1.0; 216 | if (self.volume == 0) 217 | self.volume = 0.5; 218 | if (self.wait == 0) 219 | self.wait = 0.25; 220 | self.state = 0; 221 | }; 222 | --------------------------------------------------------------------------------