?? misc.cpp
字號:
//-----------------------------------------------------------------------------
//
// $Logfile:: /Quake 2 Engine/Sin/code/game/misc.cpp $
// $Revision:: 152 $
// $Author:: Jimdose $
// $Date:: 11/19/98 9:29p $
//
// Copyright (C) 1997 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source is may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// $Log:: /Quake 2 Engine/Sin/code/game/misc.cpp $
//
// 152 11/19/98 9:29p Jimdose
// fixed telefrags
//
// 151 11/18/98 6:26p Markd
// Took out fov update for non zero gravaxis
//
// 150 11/16/98 11:15p Markd
// made shatter sound not use PHS
//
// 149 11/16/98 12:57a Markd
// made teleporters work with gravaxis
//
// 148 11/14/98 11:17p Markd
// bullet proofed glass sounds
//
// 147 11/14/98 7:57p Markd
// fixed some global alias problems
//
// 146 11/14/98 1:33a Markd
// fixed shatter using randomglobal sound instead of just normal sound
//
// 145 11/13/98 6:28p Aldie
// Make Oxygenator only respond to players
//
// 144 11/11/98 10:02p Jimdose
// added ClipBox
//
// 143 10/26/98 4:29p Aldie
// Changed misc_oxygen timer
//
// 142 10/25/98 9:11p Markd
// put in null other protection for activate targets
//
// 141 10/24/98 12:42a Markd
// changed origins to worldorigins where appropriate
//
// 140 10/19/98 12:07a Jimdose
// made all code use fast checks for inheritance (no text lookups when
// possible)
// isSubclassOf no longer requires ::_classinfo()
//
// 139 10/17/98 9:42p Markd
// got rid of event
//
// 138 10/17/98 8:14p Jimdose
// Changed Damage to DamgeEvent
//
// 137 10/16/98 12:58a Aldie
// Null check for shatter damage
//
// 136 10/14/98 12:12a Aldie
// Added intermission file ability
//
// 135 10/07/98 11:53p Jimdose
// Added BloodSplat
//
// 134 10/06/98 10:51p Aldie
// Created an oxygenator
//
// 133 10/05/98 11:29p Markd
// Added MakeBreakingSound
//
// 132 10/05/98 4:35p Markd
// Made Teleport check for NULL entity
//
// 131 9/18/98 8:14p Markd
// rewrote surface system so that surfaces are now damaged by surface name
// instead of by surfinfo
//
// 130 9/17/98 4:11p Aldie
// Teleport objects and a fix for damage_surfaces
//
// 129 9/15/98 6:37p Markd
// Added RotatedBounds flag support
//
// 128 9/14/98 3:12p Markd
// replaced zombie/z_hit with debris_generic
//
// 127 9/09/98 5:06p Markd
// change fov when teleporting
//
// 126 9/08/98 4:06p Markd
// Fixed damagable surfaces
//
// 125 9/02/98 12:54p Markd
// fixed teleporters for players
//
// 124 9/01/98 3:05p Markd
// Rewrote explosion code
//
// 123 8/31/98 7:45p Aldie
// Updated surface data structure and removed surfinfo field
//
// 122 8/29/98 9:44p Jimdose
// Added call info to G_Trace
// Moved bodyque to deadbody.cpp
//
// 121 8/29/98 5:27p Markd
// added specialfx, replaced misc with specialfx where appropriate
//
// 120 8/29/98 2:53p Aldie
// Updated printing of location based damage
//
// 119 8/29/98 1:02p Markd
// objects won't shatter unless they hit the world
//
// 118 8/29/98 12:59p Markd
// Fixed func_explodingwall stuff
//
// 117 8/27/98 9:02p Jimdose
// Changed centroid to a variable
//
// 116 8/27/98 3:56p Jimdose
// Fixed NULL pointer bug in DamageSpecificSurface
//
// 115 8/26/98 5:37p Aldie
// Removed damage_threshold field from surfinfo
//
// 114 8/24/98 6:52p Jimdose
// Added SetGravityAxis
//
// 113 8/22/98 9:36p Jimdose
// Added support for alternate gravity axis
//
// 112 8/20/98 8:38p Jimdose
// DamageSpecificSurface now generates an AI sound event
//
// 111 8/19/98 8:49p Aldie
// Added random particles for server use
//
// 110 8/18/98 11:08p Markd
// Added new Alias System
//
// 109 8/17/98 4:34p Markd
// Added SendOverlay
//
// 108 8/08/98 9:03p Aldie
// Removed printf
//
// 107 8/08/98 8:51p Aldie
// Added func_spawnchain and changed spawns to entities
//
// 106 8/08/98 3:16p Aldie
// Added func_spawnoutofsight to spawn things out of sight of the player.
//
// 105 8/04/98 5:56p Markd
// Added FuncRemove
//
// 104 8/02/98 9:00p Markd
// Merged code 3.17
//
// 103 7/29/98 2:31p Aldie
// Changed health to a float
//
// 102 7/26/98 5:16a Aldie
// Fixed angle on the func_spawn
//
// 101 7/25/98 8:00p Aldie
// Move lightstyle client side
//
// 100 7/25/98 2:09a Jimdose
// Added an assertion to Projectile::Setup
//
// 99 7/23/98 6:17p Aldie
// Updated damage system and fixed some damage related bugs. Also put tracers
// back to the way they were, and added gib event to funcscriptmodels
//
// 98 7/22/98 11:44a Aldie
// Updated doc for func_spawn stuff
//
// 97 7/21/98 4:22p Aldie
// Put some error checking in func_spawn and func_respawn
//
// 96 7/21/98 1:10p Aldie
// Added meansofdeath to obituaries
//
// 95 7/20/98 5:45p Markd
// Put in new shooting out light behaviors
//
// 94 7/19/98 10:42p Aldie
// Check for weird happenings of dead bodies.
//
// 93 7/17/98 6:08p Aldie
// Changed func_spawn targetname to spawntargetname
//
// 92 7/17/98 4:40p Aldie
// Added targetnames to func_spawn
//
// 91 7/15/98 6:27p Aldie
// Changed func spawn to get a string arg.
//
// 90 7/15/98 6:18p Markd
// re-ordered SpawnTempDlight arguments
//
// 89 7/14/98 3:53p Markd
// fixed velocity[2] factor of exploding stuff
//
// 88 7/13/98 4:59p Aldie
// Added dead player bodies with gibbing
//
// 87 7/11/98 4:26p Aldie
// Sined fix for func_spawn and func_respawn
//
// 86 7/11/98 4:12p Aldie
// Dialog layouts
//
// 85 7/11/98 2:49p Markd
// Added SendDialog event
//
// 84 7/10/98 10:00p Markd
// made func_explodingwalls work better
//
// 83 7/10/98 7:07p Aldie
// fixed bug with other not being set for explosion
//
// 82 7/10/98 4:10p Markd
// Revamped func_explodingwall
//
// 81 7/08/98 3:11p Aldie
// Added a func_respawn that triggers when the thing it spawns is killed.
//
// 80 7/03/98 4:10p Jimdose
// Fixed Detail brushes so they aren't removed twice (causing a crash)
//
// 79 7/02/98 7:57p Markd
// redid func_explodingwall and func_glass
//
// 78 6/30/98 4:37p Markd
// Added "noise" to func_shatter and func_glass
//
// 77 6/29/98 8:18p Aldie
//
// 76 6/25/98 8:47p Markd
// Added keyed items for Triggers, Rewrote Item class, rewrote every pickup
// method
//
// 75 6/24/98 5:08p Aldie
// Removed some warnings from func_spawn
//
// 74 6/24/98 4:50p Aldie
// Made func_spawn work.
//
// 73 6/24/98 12:39p Markd
// Added default tesselation percentage
//
// 72 6/18/98 6:20p Markd
// put in support for breakable lights
//
// 71 6/18/98 2:00p Markd
// rewrote tesselation code
//
// 70 6/17/98 7:40p Markd
// Put in ActivateTargets for both func_shatter and func_glass
//
// 69 6/17/98 6:31p Aldie
// Put start and end back into beams.
//
// 68 6/16/98 10:04p Markd
// Put in generic function for DamageSpecificSurface, reworked older two
//
// 67 6/15/98 12:25p Aldie
// Updated pulse beam
//
// 66 6/15/98 10:37a Aldie
// Added SpawnPulseBeam
//
// 65 6/10/98 2:10p Aldie
// Updated damage function.
//
// 64 6/08/98 7:22p Aldie
// Added in Damage surface by name
//
// 63 5/28/98 1:23p Aldie
// Added SpawnRocketExplosion to do particles.
//
// 62 5/27/98 6:56p Markd
// Forgot to remove smoke after creating tempmodel
//
// 61 5/27/98 6:10p Markd
// temporarily took out blood splats
//
// 60 5/27/98 6:06p Aldie
//
// 59 5/27/98 4:55p Markd
// stopped rotating blood splat
//
// 58 5/27/98 4:25a Markd
// added bloodspray to SpawnBlood
//
// 57 5/26/98 11:38p Aldie
// Updated func_spawn
//
// 56 5/26/98 9:26p Aldie
// Added func_spawn
//
// 55 5/25/98 12:22p Aldie
// Added func_electrocute
//
// 54 5/25/98 7:04p Markd
// Fixed up TempModel command
//
// 53 5/25/98 5:39p Markd
// Fixed SpawnBlood, SpawnSparks and SpawnDlight
//
// 52 5/24/98 8:46p Jimdose
// Made a lot of functions more str-friendly.
// Got rid of a lot of char * based strings
// Cleaned up get spawn arg functions and sound functions
// sound functions now use consistant syntax
//
// 51 5/24/98 3:48p Jimdose
// maxhealth was supposed to be max_health
//
// 50 5/24/98 3:36p Markd
// Added impact sounds for glass
//
// 49 5/24/98 1:03a Jimdose
// Added sound events for ai
//
// 48 5/23/98 10:39p Markd
// Added TempModel call
//
// 47 5/20/98 1:33p Markd
// Changed func_shatter behavior
//
// 46 5/18/98 8:13p Jimdose
// Renamed Navigator back to PathManager
//
// 45 5/16/98 4:59p Markd
// Changed func_shatter
//
// 44 5/13/98 6:19p Markd
// Added BurnWall
//
// 43 5/13/98 4:46p Aldie
// Fixed damage surfaces.
//
// 42 5/12/98 1:21p Aldie
// Update damage surfaces
//
// 41 5/06/98 7:48p Markd
// Added state and light style support to damaged textures
//
// 40 5/05/98 8:37p Aldie
// Added virtual setup function to Projectile.
//
// 39 5/05/98 5:34p Aldie
// Updated damage surfaces
//
// 38 5/05/98 2:38p Jimdose
// Disabled spawnblood
//
// 37 5/03/98 8:10p Markd
// Added SpawnSparks and patched SpawnBlood
//
// 36 5/03/98 4:35p Jimdose
// Changed Vector class
//
// 35 5/02/98 8:48p Markd
// Added lightstyle for blood
//
// 34 5/01/98 11:09a Markd
// Added sound to tesselation event
//
// 33 4/28/98 4:04p Jimdose
// Fixed typo in docs for func_shatter and func_glass
//
// 32 4/27/98 3:52p Jimdose
// Teleporters inform Navigator when used so that paths may be generated
// through them
//
// 31 4/18/98 2:32p Jimdose
// Added ExplodingWall, Shatter, and Glass
//
// 30 4/10/98 4:57p Jimdose
// Made bubbles work better
//
// 29 4/07/98 11:54p Jimdose
// Changed beams to use color_r, color_g, and color_b
//
// 28 4/05/98 5:05a Jimdose
// fixed teleport not responding bug
//
// 27 4/05/98 1:57a Jimdose
// Fixed bug in DamageSurface where the surface was referenced without checking
// for a null pointer
//
// 26 4/04/98 6:06p Jimdose
// Added Bubble, Projectile, and Smoke
// Made response from EV_Trigger_ActivateTargets to EV_Trigger_Effect
//
// 25 4/01/98 6:05p Jimdose
// Made setBeam use setOrigin
//
// 24 3/30/98 2:40p Jimdose
// Made teleporters handle non-clients
// Reenabled spawnblood
//
// 23 3/29/98 9:41p Jimdose
// Changed killed to an event
//
// 22 3/28/98 6:39p Jimdose
// Left some code commented out. oops! :P
//
// 21 3/28/98 6:37p Jimdose
// Made teleporters work
//
// 20 3/23/98 1:31p Jimdose
// Revamped event and command system
//
// 19 3/11/98 2:23p Jimdose
// Moved AreaPortals to areaportal.cpp
// Breakaway walls now use areaportals
//
// 18 3/05/98 3:48p Aldie
// More damage surfaces stuff.
//
// 17 3/04/98 8:01p Aldie
// More support for damage surfaces.
//
// 16 3/02/98 8:49p Jimdose
// Changed the classid parameter of CLASS_DECLARATION to a quoted string so
// that you could have a NULL classid.
//
// 15 3/02/98 5:42p Jimdose
// Moved light entities to light.cpp
//
// 14 2/27/98 12:50p Jimdose
// Added Light, LightRamp, and TriggerLightStyle
//
// 13 2/21/98 1:07p Jimdose
// Added Beam class
//
// 12 2/17/98 8:09p Jimdose
// Changed Detail to print a warning if it has a null model
//
// 11 2/06/98 5:39p Jimdose
// Moved Sined definitions into file
//
// 9 2/03/98 10:43a Jimdose
// Updated to work with Quake 2 engine
//
// 7 11/11/97 10:22a Markd
// Added precache for zombie/z_hit.wav
//
// 6 10/29/97 4:18p Jimdose
// Bubbles can now only exist in water.
//
// 5 10/28/97 8:20p Jimdose
// added Bubble
//
// 4 10/27/97 3:29p Jimdose
// Removed dependency on quakedef.h
//
// 3 10/01/97 11:24a Markd
// moved viewthing to its own file
//
// 2 9/26/97 6:14p Jimdose
// Added standard Ritual headers
//
// DESCRIPTION:
// Basically the big stew pot of the DLLs, or maybe a garbage bin, whichever
// metaphore you prefer. This really should be cleaned up. Anyway, this
// should contain utility functions that could be used by any entity.
// Right now it contains everything from entities that could be in their
// own file to my mother's pot roast recipes.
//
#include "g_local.h"
#include "entity.h"
#include "trigger.h"
#include "explosion.h"
#include "areaportal.h"
#include "misc.h"
#include "navigate.h"
#include "deadbody.h"
#include "specialfx.h"
#include "player.h"
/*
================
SendDialog
================
*/
void SendDialog
(
const char *icon_name,
const char *dialog_text
)
{
char imageindex;
char temp[ 1024 ];
imageindex = gi.imageindex( icon_name );
Com_sprintf( temp, sizeof( temp ), "dia %d \"%s\"", imageindex, dialog_text );
gi.WriteByte( svc_console_command );
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -