mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
afx magic spell membervar cleanup (plus an additional shadowvar one in magic missile)
This commit is contained in:
parent
8353d87a49
commit
0df2cf1b9d
3 changed files with 685 additions and 685 deletions
|
|
@ -532,9 +532,9 @@ bool afxMagicMissileData::preload(bool server, String &errorStr)
|
||||||
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
String errorStr;
|
String sfxErrorStr;
|
||||||
if( !sfxResolve( &sound, errorStr ) )
|
if( !sfxResolve( &sound, sfxErrorStr) )
|
||||||
Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet: %s", errorStr.c_str());
|
Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet: %s", sfxErrorStr.c_str());
|
||||||
|
|
||||||
if (!lightDesc && lightDescId != 0)
|
if (!lightDesc && lightDescId != 0)
|
||||||
if (Sim::findObject(lightDescId, lightDesc) == false)
|
if (Sim::findObject(lightDescId, lightDesc) == false)
|
||||||
|
|
@ -1864,7 +1864,7 @@ SceneObject* afxMagicMissile::get_default_launcher() const
|
||||||
if (mDataBlock->reverse_targeting)
|
if (mDataBlock->reverse_targeting)
|
||||||
{
|
{
|
||||||
if (dynamic_cast<afxMagicSpell*>(choreographer))
|
if (dynamic_cast<afxMagicSpell*>(choreographer))
|
||||||
launch_cons_obj = ((afxMagicSpell*)choreographer)->target;
|
launch_cons_obj = ((afxMagicSpell*)choreographer)->mTarget;
|
||||||
if (!launch_cons_obj)
|
if (!launch_cons_obj)
|
||||||
{
|
{
|
||||||
Con::errorf("afxMagicMissile::get_launch_data(): missing target constraint object for reverse targeted missile.");
|
Con::errorf("afxMagicMissile::get_launch_data(): missing target constraint object for reverse targeted missile.");
|
||||||
|
|
@ -1874,7 +1874,7 @@ SceneObject* afxMagicMissile::get_default_launcher() const
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (dynamic_cast<afxMagicSpell*>(choreographer))
|
if (dynamic_cast<afxMagicSpell*>(choreographer))
|
||||||
launch_cons_obj = ((afxMagicSpell*)choreographer)->caster;
|
launch_cons_obj = ((afxMagicSpell*)choreographer)->mCaster;
|
||||||
if (!launch_cons_obj)
|
if (!launch_cons_obj)
|
||||||
{
|
{
|
||||||
Con::errorf("afxMagicMissile::get_launch_data(): missing launch constraint object missile.");
|
Con::errorf("afxMagicMissile::get_launch_data(): missing launch constraint object missile.");
|
||||||
|
|
@ -2036,17 +2036,17 @@ void afxMagicMissile::launch()
|
||||||
{
|
{
|
||||||
if (mDataBlock->reverse_targeting)
|
if (mDataBlock->reverse_targeting)
|
||||||
{
|
{
|
||||||
missile_target = spell->caster;
|
missile_target = spell->mCaster;
|
||||||
collide_exempt = spell->target;
|
collide_exempt = spell->mTarget;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
missile_target = spell->target;
|
missile_target = spell->mTarget;
|
||||||
collide_exempt = spell->caster;
|
collide_exempt = spell->mCaster;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spell->caster)
|
if (spell->mCaster)
|
||||||
processAfter(spell->caster);
|
processAfter(spell->mCaster);
|
||||||
if (missile_target)
|
if (missile_target)
|
||||||
deleteNotify(missile_target);
|
deleteNotify(missile_target);
|
||||||
if (collide_exempt)
|
if (collide_exempt)
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -68,36 +68,36 @@ class afxMagicSpellData : public afxChoreographerData, public afxMagicSpellDefs
|
||||||
void validateType(SimObject *object, void *typePtr);
|
void validateType(SimObject *object, void *typePtr);
|
||||||
};
|
};
|
||||||
|
|
||||||
bool do_id_convert;
|
bool mDo_id_convert;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
F32 casting_dur;
|
F32 mCasting_dur;
|
||||||
F32 delivery_dur;
|
F32 mDelivery_dur;
|
||||||
F32 linger_dur;
|
F32 mLinger_dur;
|
||||||
//
|
//
|
||||||
S32 n_casting_loops;
|
S32 mNum_casting_loops;
|
||||||
S32 n_delivery_loops;
|
S32 mNum_delivery_loops;
|
||||||
S32 n_linger_loops;
|
S32 mNum_linger_loops;
|
||||||
//
|
//
|
||||||
F32 extra_casting_time;
|
F32 mExtra_casting_time;
|
||||||
F32 extra_delivery_time;
|
F32 mExtra_delivery_time;
|
||||||
F32 extra_linger_time;
|
F32 mExtra_linger_time;
|
||||||
//
|
//
|
||||||
bool do_move_interrupts;
|
bool mDo_move_interrupts;
|
||||||
F32 move_interrupt_speed;
|
F32 mMove_interrupt_speed;
|
||||||
//
|
//
|
||||||
afxMagicMissileData* missile_db;
|
afxMagicMissileData* mMissile_db;
|
||||||
bool launch_on_server_signal;
|
bool mLaunch_on_server_signal;
|
||||||
U32 primary_target_types;
|
U32 mPrimary_target_types;
|
||||||
//
|
//
|
||||||
afxEffectWrapperData* dummy_fx_entry;
|
afxEffectWrapperData* mDummy_fx_entry;
|
||||||
|
|
||||||
// various effects lists
|
// various effects lists
|
||||||
afxEffectList casting_fx_list;
|
afxEffectList mCasting_fx_list;
|
||||||
afxEffectList launch_fx_list;
|
afxEffectList mLaunch_fx_list;
|
||||||
afxEffectList delivery_fx_list;
|
afxEffectList mDelivery_fx_list;
|
||||||
afxEffectList impact_fx_list;
|
afxEffectList mImpact_fx_list;
|
||||||
afxEffectList linger_fx_list;
|
afxEffectList mLinger_fx_list;
|
||||||
|
|
||||||
void pack_fx(BitStream* stream, const afxEffectList& fx, bool packed);
|
void pack_fx(BitStream* stream, const afxEffectList& fx, bool packed);
|
||||||
void unpack_fx(BitStream* stream, afxEffectList& fx);
|
void unpack_fx(BitStream* stream, afxEffectList& fx);
|
||||||
|
|
@ -222,39 +222,39 @@ private:
|
||||||
static StringTableEntry IMPACTED_OBJECT_CONS;
|
static StringTableEntry IMPACTED_OBJECT_CONS;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
afxMagicSpellData* datablock;
|
afxMagicSpellData* mDatablock;
|
||||||
SimObject* exeblock;
|
SimObject* mExeblock;
|
||||||
afxMagicMissileData* missile_db;
|
afxMagicMissileData* mMissile_db;
|
||||||
|
|
||||||
ShapeBase* caster;
|
ShapeBase* mCaster;
|
||||||
SceneObject* target;
|
SceneObject* mTarget;
|
||||||
SimObject* caster_field;
|
SimObject* mCaster_field;
|
||||||
SimObject* target_field;
|
SimObject* mTarget_field;
|
||||||
|
|
||||||
U16 caster_scope_id;
|
U16 mCaster_scope_id;
|
||||||
U16 target_scope_id;
|
U16 mTarget_scope_id;
|
||||||
bool target_is_shape;
|
bool mTarget_is_shape;
|
||||||
|
|
||||||
bool constraints_initialized;
|
bool mConstraints_initialized;
|
||||||
bool scoping_initialized;
|
bool mScoping_initialized;
|
||||||
|
|
||||||
U8 spell_state;
|
U8 mSpell_state;
|
||||||
F32 spell_elapsed;
|
F32 mSpell_elapsed;
|
||||||
|
|
||||||
afxConstraintID listener_cons_id;
|
afxConstraintID mListener_cons_id;
|
||||||
afxConstraintID caster_cons_id;
|
afxConstraintID mCaster_cons_id;
|
||||||
afxConstraintID target_cons_id;
|
afxConstraintID mTarget_cons_id;
|
||||||
afxConstraintID impacted_cons_id;
|
afxConstraintID mImpacted_cons_id;
|
||||||
afxConstraintID camera_cons_id;
|
afxConstraintID mCamera_cons_id;
|
||||||
SceneObject* camera_cons_obj;
|
SceneObject* mCamera_cons_obj;
|
||||||
|
|
||||||
afxPhrase* phrases[NUM_PHRASES];
|
afxPhrase* mPhrases[NUM_PHRASES];
|
||||||
F32 tfactors[NUM_PHRASES];
|
F32 mTfactors[NUM_PHRASES];
|
||||||
|
|
||||||
bool notify_castbar;
|
bool mNotify_castbar;
|
||||||
F32 overall_time_factor;
|
F32 mOverall_time_factor;
|
||||||
|
|
||||||
U16 marks_mask;
|
U16 mMarks_mask;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init();
|
void init();
|
||||||
|
|
@ -278,13 +278,13 @@ protected:
|
||||||
virtual void unpack_constraint_info(NetConnection* conn, BitStream* stream);
|
virtual void unpack_constraint_info(NetConnection* conn, BitStream* stream);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
afxMagicMissile* missile;
|
afxMagicMissile* mMissile;
|
||||||
bool missile_is_armed;
|
bool mMissile_is_armed;
|
||||||
SceneObject* impacted_obj;
|
SceneObject* mImpacted_obj;
|
||||||
Point3F impact_pos;
|
Point3F mImpact_pos;
|
||||||
Point3F impact_norm;
|
Point3F mImpact_norm;
|
||||||
U16 impacted_scope_id;
|
U16 mImpacted_scope_id;
|
||||||
bool impacted_is_shape;
|
bool mImpacted_is_shape;
|
||||||
|
|
||||||
void init_missile_s(afxMagicMissileData* mm);
|
void init_missile_s(afxMagicMissileData* mm);
|
||||||
void launch_missile_s();
|
void launch_missile_s();
|
||||||
|
|
@ -353,15 +353,15 @@ public:
|
||||||
void postSpellEvent(U8 event);
|
void postSpellEvent(U8 event);
|
||||||
void resolveTimeFactors();
|
void resolveTimeFactors();
|
||||||
|
|
||||||
void setTimeFactor(F32 f) { overall_time_factor = (f > 0) ? f : 1.0f; }
|
void setTimeFactor(F32 f) { mOverall_time_factor = (f > 0) ? f : 1.0f; }
|
||||||
F32 getTimeFactor() { return overall_time_factor; }
|
F32 getTimeFactor() { return mOverall_time_factor; }
|
||||||
void setTimeFactor(U8 phase, F32 f) { tfactors[phase] = (f > 0) ? f : 1.0f; }
|
void setTimeFactor(U8 phase, F32 f) { mTfactors[phase] = (f > 0) ? f : 1.0f; }
|
||||||
F32 getTimeFactor(U8 phase) { return tfactors[phase]; }
|
F32 getTimeFactor(U8 phase) { return mTfactors[phase]; }
|
||||||
|
|
||||||
ShapeBase* getCaster() const { return caster; }
|
ShapeBase* getCaster() const { return mCaster; }
|
||||||
SceneObject* getTarget() const { return target; }
|
SceneObject* getTarget() const { return mTarget; }
|
||||||
afxMagicMissile* getMissile() const { return missile; }
|
afxMagicMissile* getMissile() const { return mMissile; }
|
||||||
SceneObject* getImpactedObject() const { return impacted_obj; }
|
SceneObject* getImpactedObject() const { return mImpacted_obj; }
|
||||||
|
|
||||||
virtual void restoreObject(SceneObject*);
|
virtual void restoreObject(SceneObject*);
|
||||||
|
|
||||||
|
|
@ -377,7 +377,7 @@ public:
|
||||||
|
|
||||||
inline bool afxMagicSpell::is_caster_moving()
|
inline bool afxMagicSpell::is_caster_moving()
|
||||||
{
|
{
|
||||||
return (caster) ? (caster->getVelocity().len() > datablock->move_interrupt_speed) : false;
|
return (mCaster) ? (mCaster->getVelocity().len() > mDatablock->mMove_interrupt_speed) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool afxMagicSpell::is_caster_client(ShapeBase* caster, GameConnection* conn)
|
inline bool afxMagicSpell::is_caster_client(ShapeBase* caster, GameConnection* conn)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue