11using namespace Tempest;
22 if(!k.pfx_fly_gravity_s.empty())
25 if(!k.pfx_shp_dim_s.empty())
30 if(!k.pfx_shp_offset_vec_s.empty())
48 if(!k.em_self_rot_vel_s.empty())
50 if(!k.em_trj_mode_s.empty())
51 emTrjMode = VisualFx::loadTrajectory(k.em_trj_mode_s);
54 emFXLifeSpan = k.em_fx_lifespan<0 ? 0 : uint64_t(k.em_fx_lifespan*1000.f);
57VisualFx::VisualFx(
const zenkit::IEffectBase& fx, zenkit::DaedalusVm& vm, std::string_view name) {
65 emTrjMode = loadTrajectory(fx.em_trj_mode_s);
85 emFXTriggerDelay = fx.em_fx_trigger_delay<0 ? 0 : uint64_t(fx.em_fx_trigger_delay*1000.f);
94 emFXLifeSpan = fx.em_fx_lifespan<0 ? 0 : uint64_t(fx.em_fx_lifespan*1000.f);
98 emInvestNextKeyDuration = fx.em_invest_next_key_duration<0 ? 0 : uint64_t(fx.em_invest_next_key_duration*1000.f);
101 for(
size_t i=0; i<zenkit::IEffectBase::user_string_count; ++i)
110 c =
char(std::toupper(c));
122 auto id = vm.find_symbol_by_name(kname);
125 auto key = vm.init_instance<zenkit::IParticleEffectEmitKey>(id);
130 for(
int i=1; ; ++i) {
132 auto id = vm.find_symbol_by_name(kname);
135 auto key = vm.init_instance<zenkit::IParticleEffectEmitKey>(id);
137 investKeys.emplace_back(*
key);
155 if(
size_t(keyLvl)<investKeys.size())
156 return &investKeys[size_t(keyLvl)];
160 if(!hasKey[
int(type)])
162 return &keys[int(type)];
167 while(str.size()>0) {
168 auto sp = str.find(
' ');
169 auto word = str.substr(0,sp);
173 else if(word==
"TARGET") {
176 else if(word==
"LINE") {
179 else if(word==
"SPLINE") {
182 else if(word==
"RANDOM") {
185 else if(word==
"FIXED") {
188 else if(word==
"FOLLOW") {
192 Log::d(
"unknown trajectory flag: \"",word,
"\"");
194 if(sp==std::string_view::npos)
196 str = str.substr(sp+1);
206 if(str==
"PINGPONG_ONCE")
220 if(str==
"COLLISIONNORMAL")
222 if(str==
"TRAJECTORY")
230 auto sp = sv.find(
' ');
231 auto word = sv.substr(0,sp);
232 if(word==
"COLLIDE") {
235 else if(word==
"CREATE") {
238 else if(word==
"CREATEONCE") {
241 else if(word==
"NORESP") {
244 else if(word==
"NORESP") {
247 else if(word==
"CREATEQUAD") {
251 Log::d(
"unknown collision flag: \"",word,
"\"");
253 if(sp==std::string_view::npos)
255 sv = sv.substr(sp+1);
auto loadParticleFx(std::string_view name, bool relaxed=false) -> const ParticleFx *
auto loadVisualFx(std::string_view name) -> const VisualFx *
std::string lightPresetName
std::string pfx_shpDistribType_S
std::string pfx_dirModeTargetFOR_S
const VisualFx * emCreateFXID
std::string pfx_dirModeTargetPos_S
float pfx_shpDistribWalkSpeed
const ParticleFx * visName
std::string pfx_dirMode_S
std::string userString[zenkit::IEffectBase::user_string_count]
const VisualFx * emFXCollDynPerc
VisualFx(const zenkit::IEffectBase &src, zenkit::DaedalusVm &tmpVm, std::string_view name)
Material::AlphaFunc visAlphaBlendFunc
PfxEmitter visual(World &owner) const
Tempest::Vec3 emSelfRotVel
CollisionAlign emFXCollDynAlign
std::string lightPresetName
const VisualFx * emFXCreate
Collision emActionCollDyn
const VisualFx * emFXCollStat
bool emTrjDynUpdateTargetOnly
std::string emTrjTargetNode
std::string emTrjOriginNode
CollisionAlign emFXCollStatAlign
uint64_t emFXTriggerDelay
uint64_t emInvestNextKeyDuration
uint64_t effectPrefferedTime() const
std::string emFXInvestOrigin
float emTrjDynUpdateDelay
Collision emActionCollStat
const VisualFx * emFXCollDyn
const Key * key(SpellFxKey type, int32_t keyLvl=0) const
std::string emFXInvestTarget
Tempest::Vec3 loadVec3(std::string_view src)
Tempest::Vec2 loadVec2(std::string_view src)
Material::AlphaFunc loadAlpha(std::string_view src)