Torque3D Documentation / _generateds / afxAreaDamage.cpp

afxAreaDamage.cpp

Engine/source/afx/ce/afxAreaDamage.cpp

More...

Public Defines

define
myOffset(field) (field, )

Public Functions

ConsoleDocClass(afxAreaDamageData , "@brief A datablock that specifies an Area Damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "An Area Damage effect is useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> assigning area damage with unusual timing that must be synchronized with other " "effects. Negative damage amounts can be used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> healing effects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "The primary difference between <a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> and afxDamageData, which is also capable of inflicting area damage, " "is that <a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> effects calculate the area damage in C++code rather than calling out <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the script function " "radiusDamage(). In cases where area damage needs <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be inflicted repeatedly or in areas crowded with many targets, " "<a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> is likely <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get better performance." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )

Detailed Description

Public Defines

myOffset(field) (field, )

Public Functions

ConsoleDocClass(afxAreaDamageData , "@brief A datablock that specifies an Area Damage <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">effect.\n\n</a>" "An Area Damage effect is useful <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> assigning area damage with unusual timing that must be synchronized with other " "effects. Negative damage amounts can be used <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> healing effects." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" "The primary difference between <a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> and afxDamageData, which is also capable of inflicting area damage, " "is that <a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> effects calculate the area damage in C++code rather than calling out <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the script function " "radiusDamage(). In cases where area damage needs <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> be inflicted repeatedly or in areas crowded with many targets, " "<a href="/coding/class/classafxareadamagedata/">afxAreaDamageData</a> is likely <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get better performance." "\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">afxEffects\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">AFX\n</a>" " @ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">Datablocks\n</a>" )

IMPLEMENT_CO_DATABLOCK_V1(afxAreaDamageData )

  1
  2
  3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  5// Copyright (C) 2015 Faust Logic, Inc.
  6//
  7// Permission is hereby granted, free of charge, to any person obtaining a copy
  8// of this software and associated documentation files (the "Software"), to
  9// deal in the Software without restriction, including without limitation the
 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 11// sell copies of the Software, and to permit persons to whom the Software is
 12// furnished to do so, subject to the following conditions:
 13//
 14// The above copyright notice and this permission notice shall be included in
 15// all copies or substantial portions of the Software.
 16//
 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 23// IN THE SOFTWARE.
 24//
 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 26
 27#include "afx/arcaneFX.h"
 28
 29#include "afx/ce/afxAreaDamage.h"
 30
 31//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 32// afxAreaDamageData
 33
 34IMPLEMENT_CO_DATABLOCK_V1(afxAreaDamageData);
 35
 36ConsoleDocClass( afxAreaDamageData,
 37   "@brief A datablock that specifies an Area Damage effect.\n\n"
 38
 39   "An Area Damage effect is useful for assigning area damage with unusual timing that must be synchronized with other "
 40   "effects. Negative damage amounts can be used for healing effects."
 41   "\n\n"
 42
 43   "The primary difference between afxAreaDamageData and afxDamageData, which is also capable of inflicting area damage, "
 44   "is that afxAreaDamageData effects calculate the area damage in C++ code rather than calling out to the script function "
 45   "radiusDamage(). In cases where area damage needs to be inflicted repeatedly or in areas crowded with many targets, "
 46   "afxAreaDamageData is likely to get better performance."
 47   "\n\n"
 48
 49   "@ingroup afxEffects\n"
 50   "@ingroup AFX\n"
 51   "@ingroup Datablocks\n"
 52);
 53
 54afxAreaDamageData::afxAreaDamageData()
 55{
 56  flavor = ST_NULLSTRING;
 57  amount = 0;
 58  radius = 0;
 59  impulse = 0;
 60  notify_damage_src = false;
 61  exclude_cons_obj = false;
 62}
 63
 64afxAreaDamageData::afxAreaDamageData(const afxAreaDamageData& other, bool temp_clone) : GameBaseData(other, temp_clone)
 65{
 66  flavor = other.flavor;
 67  amount = other.amount;
 68  radius = other.radius;
 69  impulse = other.impulse;
 70  notify_damage_src = other.notify_damage_src;
 71  exclude_cons_obj = other.exclude_cons_obj;
 72}
 73
 74#define myOffset(field) Offset(field, afxAreaDamageData)
 75
 76void afxAreaDamageData::initPersistFields()
 77{
 78  addField("flavor",                    TypeString,     myOffset(flavor),
 79    "An arbitrary string which is passed as an argument to a spell's onDamage() script "
 80    "method. It is used to classify a type of damage such as 'melee', 'magical', or "
 81    "'fire'.");
 82  addField("damage",                    TypeF32,        myOffset(amount),
 83    "An amount of area damage to inflict on a target. Objects within half the radius "
 84    "receive full damage which then diminishes out to the full distance of the specified "
 85    "radius.");
 86  addField("radius",                    TypeF32,        myOffset(radius),
 87    "Radius centered at the effect position in which damage will be applied.");
 88  addField("impulse",                   TypeF32,        myOffset(impulse),
 89    "Specifies an amount of force to apply to damaged objects. Objects within half the "
 90    "radius receive full impulse which then diminishes out to the full distance of the "
 91    "specified radius.");
 92  addField("notifyDamageSource",        TypeBool,       myOffset(notify_damage_src),
 93    "When true, the onInflictedAreaDamage() method of the damaged object will be called "
 94    "to notify it of the damage. This is useful for starting some effects or action that "
 95    "responds to the damage.");
 96  addField("excludeConstraintObject",   TypeBool,       myOffset(exclude_cons_obj),
 97    "When true, the object specified as the effect's primary position constraint will not "
 98    "receive any damage.");
 99
100  Parent::initPersistFields();
101}
102
103bool afxAreaDamageData::onAdd()
104{
105  if (Parent::onAdd() == false)
106    return false;
107
108  return true;
109}
110
111void afxAreaDamageData::packData(BitStream* stream)
112{
113   Parent::packData(stream);
114}
115
116void afxAreaDamageData::unpackData(BitStream* stream)
117{
118  Parent::unpackData(stream);
119}
120
121
122//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
123