From 1137f59fad2cbbb8f9710c4426212b53c804e8d5 Mon Sep 17 00:00:00 2001 From: div0 Date: Fri, 25 Jan 2008 11:31:42 +0000 Subject: [PATCH] new entity misc_laser with particle effect misc_laser_beam git-svn-id: svn://svn.icculus.org/nexuiz/trunk@3271 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/default.cfg | 8 ++ data/effectinfo.txt | 44 ++++++++++ data/keybinds.txt | 139 ++++++++++++++++---------------- data/qcsrc/server/g_damage.qc | 1 + data/qcsrc/server/g_triggers.qc | 65 +++++++++++++++ 5 files changed, 188 insertions(+), 69 deletions(-) diff --git a/data/default.cfg b/data/default.cfg index 178f3dfb6..60fe7dbd2 100644 --- a/data/default.cfg +++ b/data/default.cfg @@ -861,3 +861,11 @@ seta menu_maxplayers 8 // maxplayers value when the menu starts a game // useful vote aliases alias endmatch "timelimit -1" + +// useful keybind to maximize the chat area temporarily +alias +con_chat_maximize "set _backup_con_chatpos $con_chatpos; set _backup_con_chat $con_chat; set _backup_con_notify $con_notify; set _backup_con_chattime $con_chattime; set _backup_cl_deathscoreboard $cl_deathscoreboard; con_chatpos -7; con_chat 100; con_notify 0; con_chattime 3600; cl_deathscoreboard 0" +alias -con_chat_maximize "con_chatpos $_backup_con_chatpos; con_chat $_backup_con_chat; con_notify _backup_con_notify; con_chattime $_backup_con_chattime; cl_deathscoreboard $_backup_cl_deathscoreboard" + +// tab completion +set con_completion_playdemo *.dem +set con_completion_timedemo *.dem diff --git a/data/effectinfo.txt b/data/effectinfo.txt index 4ff9e3365..a039eeb27 100644 --- a/data/effectinfo.txt +++ b/data/effectinfo.txt @@ -1966,3 +1966,47 @@ effect grapple_impact lightradius 160 lightradiusfade 800 lightcolor 1 0 0 + + + +effect misc_laser_beam +countabsolute 1 +type beam +tex 60 60 +size 1 1 +alpha 256 256 64 +color 0xff0000 0xff0000 +sizeincrease 1 + +effect misc_laser_beam_end +count 1 +type spark +color 0x8f4333 0xfff31b +size 0.4 0.4 +alpha 128 256 768 +gravity 1 +bounce -1 +velocityjitter 64 64 64 +velocitymultiplier 100 + + + +effect misc_laser_beam_fast +countabsolute 1 +type beam +tex 60 60 +size 1 1 +alpha 256 256 640 +color 0xff0000 0xff0000 +sizeincrease 0.1 + +effect misc_laser_beam_fast_end +count 1 +type spark +color 0x8f4333 0xfff31b +size 0.4 0.4 +alpha 128 256 768 +gravity 1 +bounce -1 +velocityjitter 64 64 64 +velocitymultiplier 100 diff --git a/data/keybinds.txt b/data/keybinds.txt index 79b69cfab..958a4e7c6 100644 --- a/data/keybinds.txt +++ b/data/keybinds.txt @@ -1,69 +1,70 @@ -"" "Moving" -"+forward" "forward" -"+back" "backpedal" -"+moveleft" "strafe left" -"+moveright" "strafe right" -"+jump" "jump / swim" -"+crouch" "crouch / sink" -"+hook" "grappling hook" -"" "" -"" "Attacking" -"+attack" "primary fire" -"+attack2" "secondary fire" -"" "" -"" "Weapon switching" -"weapprev" "previous" -"weapnext" "next" -"weaplast" "previously used" -"impulse 1" "laser" -"impulse 2" "shotgun" -"impulse 3" "machine gun" -"impulse 4" "mortar" -"impulse 5" "electro" -"impulse 6" "crylink" -"impulse 7" "nex" -"impulse 8" "hagar" -"impulse 9" "rocket launcher" -"" "" -"" "View" -"+zoom" "zoom" -"+showscores" "show scores" -"screenshot" "screen shot" -"" "" -"" "Communicate" -"messagemode" "public chat" -"messagemode2" "team chat" -"vyes" "vote YES" -"vno" "vote NO" -"ready" "ready" -"" "" -"" "Client" -"+show_info" "server info" -"toggleconsole" "enter console" -"disconnect" "disconnect" -"quit" "quit" -"" "" -"" "Teamplay" -"messagemode2" "team chat" -"menu_showteamselect" "switch team" -"spec" "enter spectator mode" -"dropweapon" "drop weapon" -"+use" "drop key" -"" "" -"" "User defined" -"+userbind 1" "$userbind1" -"+userbind 2" "$userbind2" -"+userbind 3" "$userbind3" -"+userbind 4" "$userbind4" -"+userbind 5" "$userbind5" -"+userbind 6" "$userbind6" -"+userbind 7" "$userbind7" -"+userbind 8" "$userbind8" -"+userbind 9" "$userbind9" -"+userbind 10" "$userbind10" -"+userbind 11" "$userbind11" -"+userbind 12" "$userbind12" -"+userbind 13" "$userbind13" -"+userbind 14" "$userbind14" -"+userbind 15" "$userbind15" -"+userbind 16" "$userbind16" +"" "Moving" +"+forward" "forward" +"+back" "backpedal" +"+moveleft" "strafe left" +"+moveright" "strafe right" +"+jump" "jump / swim" +"+crouch" "crouch / sink" +"+hook" "grappling hook" +"" "" +"" "Attacking" +"+attack" "primary fire" +"+attack2" "secondary fire" +"" "" +"" "Weapon switching" +"weapprev" "previous" +"weapnext" "next" +"weaplast" "previously used" +"impulse 1" "laser" +"impulse 2" "shotgun" +"impulse 3" "machine gun" +"impulse 4" "mortar" +"impulse 5" "electro" +"impulse 6" "crylink" +"impulse 7" "nex" +"impulse 8" "hagar" +"impulse 9" "rocket launcher" +"" "" +"" "View" +"+zoom" "zoom" +"+showscores" "show scores" +"screenshot" "screen shot" +"" "" +"" "Communicate" +"messagemode" "public chat" +"messagemode2" "team chat" +"+con_chat_maximize" "show chat history" +"vyes" "vote YES" +"vno" "vote NO" +"ready" "ready" +"" "" +"" "Client" +"+show_info" "server info" +"toggleconsole" "enter console" +"disconnect" "disconnect" +"quit" "quit" +"" "" +"" "Teamplay" +"messagemode2" "team chat" +"menu_showteamselect" "switch team" +"spec" "enter spectator mode" +"dropweapon" "drop weapon" +"+use" "drop key" +"" "" +"" "User defined" +"+userbind 1" "" +"+userbind 2" "" +"+userbind 3" "" +"+userbind 4" "" +"+userbind 5" "" +"+userbind 6" "" +"+userbind 7" "" +"+userbind 8" "" +"+userbind 9" "" +"+userbind 10" "" +"+userbind 11" "" +"+userbind 12" "" +"+userbind 13" "" +"+userbind 14" "" +"+userbind 15" "" +"+userbind 16" "" diff --git a/data/qcsrc/server/g_damage.qc b/data/qcsrc/server/g_damage.qc index a1bab2953..578adbcc2 100644 --- a/data/qcsrc/server/g_damage.qc +++ b/data/qcsrc/server/g_damage.qc @@ -522,6 +522,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float // apply push if (self.damageforcescale) + if (vlen(force)) { self.velocity = self.velocity + self.damageforcescale * force; self.flags = self.flags - (self.flags & FL_ONGROUND); diff --git a/data/qcsrc/server/g_triggers.qc b/data/qcsrc/server/g_triggers.qc index bb5b62c0d..a1acf5716 100644 --- a/data/qcsrc/server/g_triggers.qc +++ b/data/qcsrc/server/g_triggers.qc @@ -555,3 +555,68 @@ void() func_snow = }; +void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float deathtype); +void() misc_laser_think = +{ + vector o; + if(!self.state) + { + self.enemy = find(world, targetname, self.target); + self.state = 1; + } + if(self.enemy) + { + o = self.enemy.origin; + } + else + { + makevectors(self.angles); + o = self.origin + v_forward * MAX_SHOT_DISTANCE; + } + + if(self.dmg) + { + if(self.dmg < 0) + FireRailgunBullet(self.origin, o, 100000, 0, DEATH_HURTTRIGGER); + else + FireRailgunBullet(self.origin, o, self.dmg * frametime, 0, DEATH_HURTTRIGGER); + } + if(time > self.ltime) + { + trailparticles(self, self.cnt, self.origin, trace_endpos); + pointparticles(self.lip, trace_endpos, trace_plane_normal, 256 * frametime); + self.ltime = time + self.wait; + } + self.nextthink = time; +} +/*QUAKED misc_laser (.5 .5 .5) ? +Any object touching the beam will be hurt +Keys: +"target" + target_position where the laser ends +"mdl" + name of beam effect to use +"dmg" + damage per second (-1 for a laser that kills immediately) +"wait" + delay between sending the particle effect +*/ +void() misc_laser = +{ + if(self.mdl) + { + self.cnt = particleeffectnum(self.mdl); + self.lip = particleeffectnum(strcat(self.mdl, "_end")); + } + else + { + self.cnt = particleeffectnum("misc_laser_beam"); + self.lip = particleeffectnum("misc_laser_beam_end"); + } + if(!self.wait) + self.wait = 1; + if(!self.message) + self.message = "saw the light"; + self.think = misc_laser_think; + self.nextthink = time; +} -- 2.39.2