1.1 --- a/plugins/include/entity_prop_stocks.inc Fri Jul 11 06:51:21 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,324 +0,0 @@
1.4 -/**
1.5 - * vim: set ts=4 :
1.6 - * =============================================================================
1.7 - * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
1.8 - * =============================================================================
1.9 - *
1.10 - * This file is part of the SourceMod/SourcePawn SDK.
1.11 - *
1.12 - * This program is free software; you can redistribute it and/or modify it under
1.13 - * the terms of the GNU General Public License, version 3.0, as published by the
1.14 - * Free Software Foundation.
1.15 - *
1.16 - * This program is distributed in the hope that it will be useful, but WITHOUT
1.17 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.18 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
1.19 - * details.
1.20 - *
1.21 - * You should have received a copy of the GNU General Public License along with
1.22 - * this program. If not, see <http://www.gnu.org/licenses/>.
1.23 - *
1.24 - * As a special exception, AlliedModders LLC gives you permission to link the
1.25 - * code of this program (as well as its derivative works) to "Half-Life 2," the
1.26 - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
1.27 - * by the Valve Corporation. You must obey the GNU General Public License in
1.28 - * all respects for all other code used. Additionally, AlliedModders LLC grants
1.29 - * this exception to all derivative works. AlliedModders LLC defines further
1.30 - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
1.31 - * or <http://www.sourcemod.net/license.php>.
1.32 - *
1.33 - * Version: $Id$
1.34 - */
1.35 -
1.36 -#if defined _entity_prop_stocks_included
1.37 - #endinput
1.38 -#endif
1.39 -#define _entity_prop_stocks_included
1.40 -
1.41 -enum MoveType
1.42 -{
1.43 - MOVETYPE_NONE = 0, /**< never moves */
1.44 - MOVETYPE_ISOMETRIC, /**< For players */
1.45 - MOVETYPE_WALK, /**< Player only - moving on the ground */
1.46 - MOVETYPE_STEP, /**< gravity, special edge handling -- monsters use this */
1.47 - MOVETYPE_FLY, /**< No gravity, but still collides with stuff */
1.48 - MOVETYPE_FLYGRAVITY, /**< flies through the air + is affected by gravity */
1.49 - MOVETYPE_VPHYSICS, /**< uses VPHYSICS for simulation */
1.50 - MOVETYPE_PUSH, /**< no clip to world, push and crush */
1.51 - MOVETYPE_NOCLIP, /**< No gravity, no collisions, still do velocity/avelocity */
1.52 - MOVETYPE_LADDER, /**< Used by players only when going onto a ladder */
1.53 - MOVETYPE_OBSERVER, /**< Observer movement, depends on player's observer mode */
1.54 - MOVETYPE_CUSTOM, /**< Allows the entity to describe its own physics */
1.55 -};
1.56 -
1.57 -enum RenderMode
1.58 -{
1.59 - RENDER_NORMAL, /**< src */
1.60 - RENDER_TRANSCOLOR, /**< c*a+dest*(1-a) */
1.61 - RENDER_TRANSTEXTURE, /**< src*a+dest*(1-a) */
1.62 - RENDER_GLOW, /**< src*a+dest -- No Z buffer checks -- Fixed size in screen space */
1.63 - RENDER_TRANSALPHA, /**< src*srca+dest*(1-srca) */
1.64 - RENDER_TRANSADD, /**< src*a+dest */
1.65 - RENDER_ENVIRONMENTAL, /**< not drawn, used for environmental effects */
1.66 - RENDER_TRANSADDFRAMEBLEND, /**< use a fractional frame value to blend between animation frames */
1.67 - RENDER_TRANSALPHAADD, /**< src + dest*(1-a) */
1.68 - RENDER_WORLDGLOW, /**< Same as kRenderGlow but not fixed size in screen space */
1.69 - RENDER_NONE, /**< Don't render. */
1.70 -};
1.71 -
1.72 -enum RenderFx
1.73 -{
1.74 - RENDERFX_NONE = 0,
1.75 - RENDERFX_PULSE_SLOW,
1.76 - RENDERFX_PULSE_FAST,
1.77 - RENDERFX_PULSE_SLOW_WIDE,
1.78 - RENDERFX_PULSE_FAST_WIDE,
1.79 - RENDERFX_FADE_SLOW,
1.80 - RENDERFX_FADE_FAST,
1.81 - RENDERFX_SOLID_SLOW,
1.82 - RENDERFX_SOLID_FAST,
1.83 - RENDERFX_STROBE_SLOW,
1.84 - RENDERFX_STROBE_FAST,
1.85 - RENDERFX_STROBE_FASTER,
1.86 - RENDERFX_FLICKER_SLOW,
1.87 - RENDERFX_FLICKER_FAST,
1.88 - RENDERFX_NO_DISSIPATION,
1.89 - RENDERFX_DISTORT, /**< Distort/scale/translate flicker */
1.90 - RENDERFX_HOLOGRAM, /**< kRenderFxDistort + distance fade */
1.91 - RENDERFX_EXPLODE, /**< Scale up really big! */
1.92 - RENDERFX_GLOWSHELL, /**< Glowing Shell */
1.93 - RENDERFX_CLAMP_MIN_SCALE, /**< Keep this sprite from getting very small (SPRITES only!) */
1.94 - RENDERFX_ENV_RAIN, /**< for environmental rendermode, make rain */
1.95 - RENDERFX_ENV_SNOW, /**< " " " , make snow */
1.96 - RENDERFX_SPOTLIGHT, /**< TEST CODE for experimental spotlight */
1.97 - RENDERFX_RAGDOLL, /**< HACKHACK: TEST CODE for signalling death of a ragdoll character */
1.98 - RENDERFX_PULSE_FAST_WIDER,
1.99 - RENDERFX_MAX
1.100 -};
1.101 -
1.102 -// These defines are for client button presses.
1.103 -#define IN_ATTACK (1 << 0)
1.104 -#define IN_JUMP (1 << 1)
1.105 -#define IN_DUCK (1 << 2)
1.106 -#define IN_FORWARD (1 << 3)
1.107 -#define IN_BACK (1 << 4)
1.108 -#define IN_USE (1 << 5)
1.109 -#define IN_CANCEL (1 << 6)
1.110 -#define IN_LEFT (1 << 7)
1.111 -#define IN_RIGHT (1 << 8)
1.112 -#define IN_MOVELEFT (1 << 9)
1.113 -#define IN_MOVERIGHT (1 << 10)
1.114 -#define IN_ATTACK2 (1 << 11)
1.115 -#define IN_RUN (1 << 12)
1.116 -#define IN_RELOAD (1 << 13)
1.117 -#define IN_ALT1 (1 << 14)
1.118 -#define IN_ALT2 (1 << 15)
1.119 -#define IN_SCORE (1 << 16) // Used by client.dll for when scoreboard is held down
1.120 -#define IN_SPEED (1 << 17) // Player is holding the speed key
1.121 -#define IN_WALK (1 << 18) // Player holding walk key
1.122 -#define IN_ZOOM (1 << 19) // Zoom key for HUD zoom
1.123 -#define IN_WEAPON1 (1 << 20) // weapon defines these bits
1.124 -#define IN_WEAPON2 (1 << 21) // weapon defines these bits
1.125 -#define IN_BULLRUSH (1 << 22)
1.126 -#define IN_GRENADE1 (1 << 23) // grenade 1
1.127 -#define IN_GRENADE2 (1 << 24) // grenade 2
1.128 -
1.129 -// CBaseEntity::m_fFlags
1.130 -// PLAYER SPECIFIC FLAGS FIRST BECAUSE WE USE ONLY A FEW BITS OF NETWORK PRECISION
1.131 -#define FL_ONGROUND (1 << 0) // At rest / on the ground
1.132 -#define FL_DUCKING (1 << 1) // Player flag -- Player is fully crouched
1.133 -#define FL_WATERJUMP (1 << 2) // player jumping out of water
1.134 -#define FL_ONTRAIN (1 << 3) // Player is _controlling_ a train, so movement commands should be ignored on client during prediction.
1.135 -#define FL_INRAIN (1 << 4) // Indicates the entity is standing in rain
1.136 -#define FL_FROZEN (1 << 5) // Player is frozen for 3rd person camera
1.137 -#define FL_ATCONTROLS (1 << 6) // Player can't move, but keeps key inputs for controlling another entity
1.138 -#define FL_CLIENT (1 << 7) // Is a player
1.139 -#define FL_FAKECLIENT (1 << 8) // Fake client, simulated server side; don't send network messages to them
1.140 -// NOTE if you move things up, make sure to change this value
1.141 -#define PLAYER_FLAG_BITS 9
1.142 -// NON-PLAYER SPECIFIC (i.e., not used by GameMovement or the client .dll ) -- Can still be applied to players, though
1.143 -#define FL_INWATER (1 << 9) // In water
1.144 -#define FL_FLY (1 << 10) // Changes the SV_Movestep() behavior to not need to be on ground
1.145 -#define FL_SWIM (1 << 11) // Changes the SV_Movestep() behavior to not need to be on ground (but stay in water)
1.146 -#define FL_CONVEYOR (1 << 12)
1.147 -#define FL_NPC (1 << 13)
1.148 -#define FL_GODMODE (1 << 14)
1.149 -#define FL_NOTARGET (1 << 15)
1.150 -#define FL_AIMTARGET (1 << 16) // set if the crosshair needs to aim onto the entity
1.151 -#define FL_PARTIALGROUND (1 << 17) // not all corners are valid
1.152 -#define FL_STATICPROP (1 << 18) // Eetsa static prop!
1.153 -#define FL_GRAPHED (1 << 19) // worldgraph has this ent listed as something that blocks a connection
1.154 -#define FL_GRENADE (1 << 20)
1.155 -#define FL_STEPMOVEMENT (1 << 21) // Changes the SV_Movestep() behavior to not do any processing
1.156 -#define FL_DONTTOUCH (1 << 22) // Doesn't generate touch functions, generates Untouch() for anything it was touching when this flag was set
1.157 -#define FL_BASEVELOCITY (1 << 23) // Base velocity has been applied this frame (used to convert base velocity into momentum)
1.158 -#define FL_WORLDBRUSH (1 << 24) // Not moveable/removeable brush entity (really part of the world, but represented as an entity for transparency or something)
1.159 -#define FL_OBJECT (1 << 25) // Terrible name. This is an object that NPCs should see. Missiles, for example.
1.160 -#define FL_KILLME (1 << 26) // This entity is marked for death -- will be freed by game DLL
1.161 -#define FL_ONFIRE (1 << 27) // You know...
1.162 -#define FL_DISSOLVING (1 << 28) // We're dissolving!
1.163 -#define FL_TRANSRAGDOLL (1 << 29) // In the process of turning into a client side ragdoll.
1.164 -#define FL_UNBLOCKABLE_BY_PLAYER (1 << 30) // pusher that can't be blocked by the player
1.165 -// END m_fFlags #defines
1.166 -
1.167 -/**
1.168 - * Get an entity's flags.
1.169 - *
1.170 - * @param entity Entity index.
1.171 - * @return Entity's flags, see m_fFlag defines above
1.172 - * @error Invalid entity index, or lack of mod compliance.
1.173 - */
1.174 -stock GetEntityFlags(entity)
1.175 -{
1.176 - return GetEntProp(entity, Prop_Data, "m_fFlags");
1.177 -}
1.178 -
1.179 -/**
1.180 - * Gets an entity's movetype.
1.181 - *
1.182 - * @param entity Entity index.
1.183 - * @return Movetype, see enum above.
1.184 - * @error Invalid entity index, or lack of mod compliance.
1.185 - */
1.186 -stock MoveType:GetEntityMoveType(entity)
1.187 -{
1.188 - new offset = GetEntSendPropOffs(entity, "movetype");
1.189 - return MoveType:GetEntData(entity, offset, 1);
1.190 -}
1.191 -
1.192 -/**
1.193 - * Sets an entity's movetype.
1.194 - *
1.195 - * @param entity Entity index.
1.196 - * @param mt Movetype, see enum above.
1.197 - * @noreturn
1.198 - * @error Invalid entity index, or lack of mod compliance.
1.199 - */
1.200 -stock SetEntityMoveType(entity, MoveType:mt)
1.201 -{
1.202 - new offset = GetEntSendPropOffs(entity, "movetype");
1.203 - SetEntData(entity, offset, mt, 1, true);
1.204 -}
1.205 -
1.206 -/**
1.207 - * Gets an entity's render mode.
1.208 - *
1.209 - * @param entity Entity index.
1.210 - * @return RenderMode value.
1.211 - * @error Invalid entity index, or lack of mod compliance.
1.212 - */
1.213 -stock RenderMode:GetEntityRenderMode(entity)
1.214 -{
1.215 - return RenderMode:GetEntProp(entity, Prop_Send, "m_nRenderMode", 1);
1.216 -}
1.217 -
1.218 -/**
1.219 - * Sets an entity's render mode.
1.220 - *
1.221 - * @param entity Entity index.
1.222 - * @param mode RenderMode value.
1.223 - * @noreturn
1.224 - * @error Invalid entity index, or lack of mod compliance.
1.225 - */
1.226 -stock SetEntityRenderMode(entity, RenderMode:mode)
1.227 -{
1.228 - SetEntProp(entity, Prop_Send, "m_nRenderMode", mode, 1);
1.229 -}
1.230 -
1.231 -/**
1.232 - * Gets an entity's render Fx.
1.233 - *
1.234 - * @param entity Entity index.
1.235 - * @return RenderFx value.
1.236 - * @error Invalid entity index, or lack of mod compliance.
1.237 - */
1.238 -stock RenderFx:GetEntityRenderFx(entity)
1.239 -{
1.240 - return RenderFx:GetEntProp(entity, Prop_Send, "m_nRenderFX", 1);
1.241 -}
1.242 -
1.243 -/**
1.244 - * Sets an entity's render Fx.
1.245 - *
1.246 - * @param entity Entity index.
1.247 - * @param fx RenderFx value.
1.248 - * @noreturn
1.249 - * @error Invalid entity index, or lack of mod compliance.
1.250 - */
1.251 -stock SetEntityRenderFx(entity, RenderFx:fx)
1.252 -{
1.253 - SetEntProp(entity, Prop_Send, "m_nRenderFX", fx, 1);
1.254 -}
1.255 -
1.256 -/**
1.257 - * Sets an entity's color.
1.258 - *
1.259 - * @param entity Entity index
1.260 - * @param r Amount of red (0-255)
1.261 - * @param g Amount of green (0-255)
1.262 - * @param b Amount of blue (0-255)
1.263 - * @param a Amount of alpha (0-255)
1.264 - * @noreturn
1.265 - * @error Invalid entity index, or lack of mod compliance.
1.266 - */
1.267 -stock SetEntityRenderColor(entity, r=255, g=255, b=255, a=255)
1.268 -{
1.269 - new offset = GetEntSendPropOffs(entity, "m_clrRender");
1.270 - SetEntData(entity, offset, r, 1, true);
1.271 - SetEntData(entity, offset + 1, g, 1, true);
1.272 - SetEntData(entity, offset + 2, b, 1, true);
1.273 - SetEntData(entity, offset + 3, a, 1, true);
1.274 -}
1.275 -
1.276 -/* GuessSDKVersion */
1.277 -
1.278 -/**
1.279 - * Gets an entity's gravity.
1.280 - *
1.281 - * @param entity Entity index.
1.282 - * @return Entity's m_flGravity value.
1.283 - * @error Invalid entity index, or lack of mod compliance.
1.284 - */
1.285 -stock Float:GetEntityGravity(entity)
1.286 -{
1.287 - return GetEntPropFloat(entity, Prop_Data, "m_flGravity");
1.288 -}
1.289 -
1.290 -/**
1.291 - * Sets an entity's gravity.
1.292 - *
1.293 - * @param entity Entity index.
1.294 - * @param amount Gravity to set (default = 1.0, half = 0.5, double = 2.0).
1.295 - * @noreturn
1.296 - * @error Invalid entity index, or lack of mod compliance.
1.297 - */
1.298 -stock SetEntityGravity(entity, Float:amount)
1.299 -{
1.300 - SetEntPropFloat(entity, Prop_Data, "m_flGravity", amount);
1.301 -}
1.302 -
1.303 -/**
1.304 - * Sets an entity's health
1.305 - *
1.306 - * @param entity Entity index.
1.307 - * @param amount Health amount.
1.308 - * @noreturn
1.309 - * @error Invalid entity index, or lack of mod compliance.
1.310 - */
1.311 -stock SetEntityHealth(entity, amount)
1.312 -{
1.313 - SetEntProp(entity, Prop_Send, "m_iHealth", amount);
1.314 -}
1.315 -
1.316 -/**
1.317 - * Get's a users current pressed buttons
1.318 - *
1.319 - * @param client Client index
1.320 - * @return Bitsum of buttons
1.321 - * @error Invalid client index, client not in game,
1.322 - * or lack of mod compliance.
1.323 - */
1.324 -stock GetClientButtons(client)
1.325 -{
1.326 - return GetEntProp(client, Prop_Data, "m_nButtons");
1.327 -}