rodecomp/Source/Contents/Effects/SpriteEffect.cpp
ragnarok-clanker dc3d5ce1a5 Maintenance: Resubmission of 14942 (gate: three existing in-class helpers whose lines changed lacked an annotation; marked // INLINED
Batch #14943 by ragnarok-clanker: no function's compiled code changes; checked with 741 compiled unit(s), including every includer of Source/ActorPickNode.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Mode/CGameMode.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeDragState.h, Source/Client/Replay.h, Source/Client/Session.h, Source/Client/Stove/StoveMgr.h, Source/Contents/AchievementMgr.h, Source/Contents/ActorNameCard.h, Source/Contents/Actors/CharacterRender.h, Source/Contents/Actors/EffectActors.h, Source/Contents/Actors/GameActor.h, Source/Contents/Actors/GrannyGameActor.h, Source/Contents/Actors/GroundScope.h, Source/Contents/Actors/Item.h, Source/Contents/Actors/Npc.h, Source/Contents/Actors/Pc.h, Source/Contents/Actors/RenderObjectState.h, Source/Contents/Actors/Skill.h, Source/Contents/AdventureGuideMgr.h, Source/Contents/Camera/Camera.h, Source/Contents/Camera/CameraState.h, Source/Contents/CashEmotionMgr.h, Source/Contents/Configuration/GameSettingsMgr.h, Source/Contents/EffectResourceSwitcher.h, Source/Contents/Effects/AMachineEffect.h, Source/Contents/Effects/AcidifiedThrow.h, Source/Contents/Effects/AxeBoomerang.h, Source/Contents/Effects/BlastForge.h, Source/Contents/Effects/CaneOfEvilEyeEffect.h, Source/Contents/Effects/CharacterParticleBundle.h, Source/Contents/Effects/CloudKillEffect.h, Source/Contents/Effects/Effect.h, Source/Contents/Effects/EffectActor.h, Source/Contents/Effects/EffectEmitter.h, Source/Contents/Effects/EffectMaker.h, Source/Contents/Effects/EffectPrimitiveState.h, Source/Contents/Effects/FuumaShouakuEffect.h, Source/Contents/Effects/GravityControlEffect.h, Source/Contents/Effects/HealSpEffect.h, Source/Contents/Effects/Level99Effect.h, Source/Contents/Effects/MapChainEffect.h, Source/Contents/Effects/MonsterSkillEffects.h, Source/Contents/Effects/MsgEffect.h, Source/Contents/Effects/NyanggrassEffect.h, Source/Contents/Effects/Particle.h, Source/Contents/Effects/PowderingEffect.h, Source/Contents/Effects/RagEffectState.h, Source/Contents/Effects/RectUpEffect.h, Source/Contents/Effects/ShadowExceedEffect.h, Source/Contents/Effects/SkillEffects.h, Source/Contents/Effects/SpriteParticle.h, Source/Contents/Effects/StormCannonEffect.h, Source/Contents/Effects/ThrowEffects.h, Source/Contents/EntryQueueMgr.h, Source/Contents/EquipmentResourceMgr.h, Source/Contents/FlyingShipRouteInfo.h, Source/Contents/Ground/GroundGeometry.h, Source/Contents/GuildInfo.h, Source/Contents/Items/ItemDescription.h, Source/Contents/Items/ItemInfo.h, Source/Contents/MapSkyMgr.h, Source/Contents/Messenger/MessengerWindows.h, Source/Contents/Models/ModelNode.h, Source/Contents/NavigationManager.h, Source/Contents/Party/AdventurerAgencyMgr.h, Source/Contents/RDamageVar.h, Source/Contents/RenewQuestMgr.h, Source/Contents/ReputeMgr.h, Source/Contents/RodexMailStore.h, Source/Contents/RouletteMgr.h, Source/Contents/Schedule/Schedule.h, Source/Contents/SignBoard/SignBoard.h, Source/Contents/Skills/ClientSkills.h, Source/Contents/Skills/PlayerSkillBundle.h, Source/Contents/Skills/SkillInfo.h, Source/Contents/SpriteLayerDrawing.h, Source/Contents/TipBoxTitles.h, Source/Contents/UserData/AccountLinkedUserDataMgr.h, Source/Contents/UserData/NormalItemSlots.h, Source/Contents/World/World.h, Source/Contents/WorldView/WorldViewData.h, Source/Render/Primitives/LightmappedPrimitive.h, Source/Render/Primitives/RenderPrimitive.h, Source/Render/Renderer.h, Source/Render/Textures/SpritePixels.h, Source/Render/Textures/Texture.h, Source/Resource/EZeffectResource.h, Source/Resource/Models/AnimatedModelResource.h, Source/Resource/Models/GrannyModelResource.h, Source/Resource/Sprites/ActionResource.h, Source/Resource/World/GroundResource.h, Source/Resource/World/WorldResource.h, Source/Resource/XmlNode.h, Source/UI/AdventureGuide/UIAdventureGuide.h, Source/UI/Buttons/UIBmpRadioBtn.h, Source/UI/Buttons/UIDescriptRace.h, Source/UI/Buttons/UIItemTagButton.h, Source/UI/Buttons/UISlotBmpButton.h, Source/UI/Buttons/UISpriteButton.h, Source/UI/Buttons/UITVTextButton.h, Source/UI/Buttons/UITextureButton.h, Source/UI/CashEmotion/UICashEmotionListWnd.h, Source/UI/CashEmotion/UICashEmotionPack.h, Source/UI/CashShop/UICashShopWnd.h, Source/UI/Chat/UIChatRoomMakeWnd.h, Source/UI/Chat/UIChatRoomTitle.h, Source/UI/Chat/UINewChatWnd.h, Source/UI/Chat/UISubChatHisWnd.h, Source/UI/Chat/UISubChatMiniWnd.h, Source/UI/Chat/UIWhisperWnd.h, Source/UI/Clan/UIClanWnd.h, Source/UI/Dialogs/UIBookWnd.h, Source/UI/Dialogs/UIChooseWarpWnd.h, Source/UI/Dialogs/UIMenuWnd.h, Source/UI/Dialogs/UIMiniMapWnd.h, Source/UI/Dialogs/UIMinimapZoomWnd.h, Source/UI/Dialogs/UINpcEditDialogWnd.h, Source/UI/Dialogs/UIPasswordWnd.h, Source/UI/Dialogs/UISayDialogWnd.h, Source/UI/Dialogs/UISelectCartWnd.h, Source/UI/Dialogs/UITipboxWnd.h, Source/UI/Edit/UIEditBoxEx.h, Source/UI/Edit/UIEditCtrl.h, Source/UI/Edit/UIEditCtrl_Currency.h, Source/UI/Edit/UIItemTagCtrl.h, Source/UI/Enchant/EnchantUI.h, Source/UI/Exchange/UIExchangeUI.h, Source/UI/FrameSkin.h, Source/UI/GameSettings/GameSettingsUI.h, Source/UI/Gauges/UIPcGage.h, Source/UI/Guild/UIGuildHelperWnd.h, Source/UI/Guild/UIGuildWnd.h, Source/UI/Guild/UIGuild_Storage_Log.h, Source/UI/Item/UIEquipmentPropertiesWnd.h, Source/UI/Item/UIItemBaseWnd.h, Source/UI/Item/UIItemPurchaseWnd.h, Source/UI/Item/UIItemSellWnd2.h, Source/UI/Item/UIItemShopWnd.h, Source/UI/Item/UIItemShopWnd2.h, Source/UI/Item/UIItemStoreFindWnd.h, Source/UI/Item/UIItemStoreSubWnd.h, Source/UI/Item/UIItemStoreWnd.h, Source/UI/Item/UIItemWnd.h, Source/UI/Item/UIMerchantItemLogWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UICardItemIllustWnd.h, Source/UI/Items/UIEquipWnd.h, Source/UI/Items/UIExchangeWnd.h, Source/UI/Items/UIGameItem.h, Source/UI/Items/UIItemCollectionWnd.h, Source/UI/Items/UIItemIdentifyWnd.h, Source/UI/Items/UIItemParamChangeDisplayWnd.h, Source/UI/Items/UISwapEquipmentWnd.h, Source/UI/Layout/WindowGeometry.h, Source/UI/Lists/UIChatHisBox.h, Source/UI/Lists/UIComboBoxV2Wnd.h, Source/UI/Lists/UIImgMenu.h, Source/UI/Lists/UIListBoxID.h, Source/UI/Lists/UIListBoxTemplate.h, Source/UI/Lists/UIMemberListBox.h, Source/UI/Lists/UITabControl.h, Source/UI/Lists/UITagListBox.h, Source/UI/Lists/UITreeView.h, Source/UI/Menu/UIMenuIconWnd.h, Source/UI/Navigation/UINavigationV4Wnd.h, Source/UI/ProbabilityTable/UIProbabilityTable.h, Source/UI/Quest/UIQuestDisplay.h, Source/UI/Quest/UIRenewQuestUI.h, Source/UI/Quest/UIRenewQuestWnd.h, Source/UI/Rodex/UIRodexComposeWnd.h, Source/UI/Rodex/UIRodexInboxWnd.h, Source/UI/RuneSystem/UIRuneSystemWindows.h, Source/UI/RuneSystem/UIRuneSystemWnd.h, Source/UI/Shop/UIMerchantItemMyShopWnd.h, Source/UI/Shop/UIMerchantItemPurchaseMSGWnd.h, Source/UI/Shop/UIMerchantItemPurchaseWnd.h, Source/UI/Shop/UIMerchantItemShopWnd.h, Source/UI/Shop/UIMerchantMirrorItemWnd.h, Source/UI/Shop/UIMerchantShopMakeWnd.h, Source/UI/Shop/UIMerchantShopTitle.h, Source/UI/Skill/UISkillDescribeWnd.h, Source/UI/Skill/UISkillListWnd.h, Source/UI/SkillDelayInfo/SkillDelayInfo.h, Source/UI/StylingShop/UIStylingShopWnd.h, Source/UI/Text/CreateLineInfo.h, Source/UI/Text/UIAchWnd.h, Source/UI/Text/UIBalloonText.h, Source/UI/Text/UINameBalloonText.h, Source/UI/Text/UIStaticTextControl.h, Source/UI/Text/UIString.h, Source/UI/Text/UITextViewerControl.h, Source/UI/UIBarGraph.h, Source/UI/UIBartermarketWnd.h, Source/UI/UIChangeMaterialWnd.h, Source/UI/UIGradeEnchantWnd.h, Source/UI/UILapineScrollBar.h, Source/UI/UIMacroBlackListCheckWnd.h, Source/UI/UIMacroDetectorWnd.h, Source/UI/UIMacroReport.h, Source/UI/UIMacroUserInfoWnd.h, Source/UI/UIPreviewEquipWnd.h, Source/UI/UIRefiningWnd.h, Source/UI/UIScrollWnd.h, Source/UI/UISlotBitmap.h, Source/UI/Window/FuncDrawWNDChar.h, Source/UI/Window/UIBattleMsgOptionWnd.h, Source/UI/Window/UIChatRoomWnd.h, Source/UI/Window/UICollectionSystemWnd.h, Source/UI/Window/UIControl.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIHotKeyWnd.h, Source/UI/Window/UIJobListWnd.h, Source/UI/Window/UILoginOTPWnd.h, Source/UI/Window/UILoginWnd.h, Source/UI/Window/UIMakeCharWnd.h, Source/UI/Window/UIMonsterDisplayWnd.h, Source/UI/Window/UIMonsterInfoWnd.h, Source/UI/Window/UINavigationHelpWnd.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UINewMakeCharWnd.h, Source/UI/Window/UINewSelectCharWnd.h, Source/UI/Window/UINoticeWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIRegisterMgr.h, Source/UI/Window/UIRoMapWnd.h, Source/UI/Window/UIRodexContentsWnd.h, Source/UI/Window/UISecondCostumeWnd.h, Source/UI/Window/UISeekPartyMBWnd.h, Source/UI/Window/UISeekPartyWnd.h, Source/UI/Window/UISelCharForUServerWnd.h, Source/UI/Window/UISerachStoreInfoWnd.h, Source/UI/Window/UITransMenuWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/UIWindowMgr.inl, Source/Utility/Lexicon/LexiconSerializer.h.
2026-11-08 16:44:36 +00:00

610 lines
20 KiB
C++

#include "Contents/Effects/EffectTypes.h"
#include "Contents/Effects/SpriteEffect.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/Actors/GameActor.h"
#include "Contents/Effects/EffectMemoryMgr.h"
#include "Contents/Effects/SpriteParticle.h"
#include "Contents/World/World.h"
#include "Utility/Cipher/XorBytes.h"
#include <cstdint>
namespace {
template <std::size_t Length, std::uint64_t Key>
class EncryptedName {
public:
// INLINED
explicit EncryptedName(const char (&source)[Length]) : m_encrypted(true) {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = source[index];
}
}
~EncryptedName() {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = 0;
}
}
const char* Text() {
if (this->m_encrypted) {
utility::XorBytes(this->m_text, Length, Key);
this->m_encrypted = false;
}
return reinterpret_cast<const char*>(this->m_text);
}
private:
std::uint8_t m_text[Length];
bool m_encrypted;
};
// INLINED
template <std::uint64_t Key, std::size_t Length>
const char* DecryptName(const char (&source)[Length]) {
thread_local EncryptedName<Length, Key> name(source);
return name.Text();
}
}
// OFFSET: 0x00B78840
// FUNCTION: fn_19194
CSpriteEffect::CSpriteEffect() : CEffect(-1) {
}
// OFFSET: 0x00B78B00
// FUNCTION: fn_19196
void CSpriteEffect::Close() {
for (auto it = this->particles.begin(); it != this->particles.end(); ++it) {
FreeParticle(*it);
}
this->particles.clear();
}
// OFFSET: 0x00B78B40
// FUNCTION: fn_19197
void CSpriteEffect::Open() {
CSpriteParticle* particle = static_cast<CSpriteParticle*>(CreateSpriteParticle(reinterpret_cast<const vector3d*>(this->position), 0x200));
if (!particle) {
return;
}
particle->effectId = this->id;
particle->columnIndex = 1;
particle->rowIndex = 0;
particle->groupIndex = 1;
this->SetupParticle(particle);
particle->actorId = this->actor;
this->particles.push_back(particle);
}
// OFFSET: 0x00B78BC0
// FUNCTION: fn_19198
void CSpriteEffect::SetupParticle(CSpriteParticle* particle) {
if (!particle) {
return;
}
particle->renderOptions |= 0x200;
particle->frameDelay = 2.0f;
particle->alpha = 255;
this->effectLifetime = 100;
switch (this->id) {
case EF_GROUND_EXPLOSION:
particle->SetSprite("이팩트\\m_ef03.spr");
particle->SetAction("이팩트\\m_ef03.act");
particle->frameDelay = 4.0f;
particle->scale = 1.5f;
break;
case EF_UNK_1130:
particle->SetSprite("이팩트\\bakuretsu_hadou\\bakuretsu_hadou.spr");
particle->SetAction("이팩트\\bakuretsu_hadou\\bakuretsu_hadou.act");
particle->renderOptions |= 0x200;
particle->depthOffset = 0.0003f;
particle->flags = 0x101;
particle->loopMode = 0;
particle->frameDelay = 8.0f;
break;
case EF_UNK_1147:
particle->SetSprite("이팩트\\EF_POPCORN\\EF_POPCORN.spr");
particle->SetAction("이팩트\\EF_POPCORN\\EF_POPCORN.act");
particle->loopMode = 1;
particle->depthOffset = 0.0003f;
particle->frameDelay = 8.0f;
break;
case EF_UNK_1151:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_NOTHING.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_NOTHING.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1152:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_WATER.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_WATER.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1153:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_GROUND.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_GROUND.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1154:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_FIRE.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_FIRE.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1155:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_WIND.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_WIND.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1156:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_POISON.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_POISON.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1157:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_SAINT.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_SAINT.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1158:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_DARKNESS.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_DARKNESS.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1159:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_TELEKINESIS.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_TELEKINESIS.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1160:
particle->SetSprite("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_UNDEAD.spr");
particle->SetAction("이팩트\\EF_IMMUNE_PROPERTY\\EF_IMMUNE_PROPERTY_UNDEAD.act");
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
break;
case EF_UNK_1192:
particle->SetSprite("이팩트\\random_opt_spr\\yellow.spr");
particle->SetAction("이팩트\\random_opt_spr\\yellow.act");
particle->loopMode = 0;
particle->frameDelay = 4.0f;
break;
case EF_UNK_1211:
case EF_UNK_1212:
case EF_UNK_1213:
particle->SetSprite("이팩트\\subject_aura\\subject_aura.spr");
particle->SetAction("이팩트\\subject_aura\\subject_aura.act");
particle->frameDelay = 8.0f;
particle->loopMode = 0;
particle->depthOffset = 0.0003f;
particle->flags = 0x101;
if (this->id == EF_UNK_1212) {
particle->animation = 0;
} else if (this->id == EF_UNK_1213) {
particle->animation = 1;
} else if (this->id == EF_UNK_1211) {
particle->animation = 2;
}
break;
case EF_BOOK_OF_DIMENSION:
particle->SetSprite("이팩트\\book_of_dimension\\book_of_dimension.spr");
particle->SetAction("이팩트\\book_of_dimension\\book_of_dimension.act");
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_UNK_1232:
particle->SetSprite("이팩트\\book_of_creatingstar\\book_of_creatingstar.spr");
particle->SetAction("이팩트\\book_of_creatingstar\\book_of_creatingstar.act");
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_CURSE_EXPLOSION:
particle->SetSprite("이팩트\\curse_explosion\\curse_explosion.spr");
particle->SetAction("이팩트\\curse_explosion\\curse_explosion.act");
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_SOUL_REAPER:
particle->SetSprite("이팩트\\soul_reaper\\soul_reaper.spr");
particle->SetAction("이팩트\\soul_reaper\\soul_reaper.act");
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_UNK_1235:
particle->SetSprite("이팩트\\soul_shadow\\soul_shadow.spr");
particle->SetAction("이팩트\\soul_shadow\\soul_shadow.act");
particle->depthOffset = 0.0003f;
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_UNK_1236:
particle->SetSprite("이팩트\\soul_fairy\\soul_fairy.spr");
particle->SetAction("이팩트\\soul_fairy\\soul_fairy.act");
particle->depthOffset = 0.0003f;
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_UNK_1237:
particle->SetSprite("이팩트\\soul_falcon\\soul_falcon.spr");
particle->SetAction("이팩트\\soul_falcon\\soul_falcon.act");
particle->depthOffset = 0.0003f;
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_SOUL_EXPLOSION:
particle->SetSprite("이팩트\\soul_explosion\\soul_explosion.spr");
particle->SetAction("이팩트\\soul_explosion\\soul_explosion.act");
particle->depthOffset = 0.0003f;
particle->frameDelay = 4.0f;
particle->loopMode = 1;
particle->flags = 0x101;
break;
case EF_UNK_1377:
particle->SetSprite("이팩트\\valkyrie_wing\\valkyrie_wing.spr");
particle->SetAction("이팩트\\valkyrie_wing\\valkyrie_wing.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 6.0f;
particle->flags = 0x101;
break;
case EF_UNK_1419:
particle->SetSprite("이팩트\\c_amdarais_effect.spr");
particle->SetAction("이팩트\\c_amdarais_effect.act");
particle->depthOffset = 0.0001f;
particle->frameDelay = 6.0f;
particle->loopMode = 0;
particle->flags = 1;
break;
case EF_UNK_1617:
particle->SetSprite("이팩트\\black_bubble\\small\\blackbubble_small.spr");
particle->SetAction("이팩트\\black_bubble\\small\\blackbubble_small.act");
particle->depthOffset = 0.0001f;
particle->frameDelay = 6.0f;
particle->loopMode = 0;
particle->flags = 1;
break;
case EF_UNK_1618:
particle->SetSprite("이팩트\\black_bubble\\midium\\blackbubble_midium.spr");
particle->SetAction("이팩트\\black_bubble\\midium\\blackbubble_midium.act");
particle->depthOffset = 0.0001f;
particle->frameDelay = 6.0f;
particle->loopMode = 0;
particle->flags = 1;
break;
case EF_UNK_1619:
particle->SetSprite("이팩트\\black_bubble\\large\\blackbubble_large.spr");
particle->SetAction("이팩트\\black_bubble\\large\\blackbubble_large.act");
particle->depthOffset = 0.0001f;
particle->frameDelay = 6.0f;
particle->loopMode = 0;
particle->flags = 1;
break;
case EF_UNK_2394:
particle->SetSprite("이팩트\\Serpent_Shadow\\Serpent_Shadow.spr");
particle->SetAction("이팩트\\Serpent_Shadow\\Serpent_Shadow.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 4.0f;
particle->flags = 0xD;
break;
case EF_UNK_2420:
particle->SetSprite("몬스터\\violen_hit.spr");
particle->SetAction("몬스터\\violen_hit.act");
particle->loopMode = 1;
particle->depthOffset = 0.001f;
particle->frameDelay = 4.0f;
break;
case EF_UNK_2424:
particle->SetSprite("이팩트\\C_Aura_Of_Ghost_S\\C_Aura_Of_Ghost_S.spr");
particle->SetAction("이팩트\\C_Aura_Of_Ghost_S\\C_Aura_Of_Ghost_S.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 4.0f;
break;
case EF_UNK_2430:
particle->SetSprite("이팩트\\C_Guide_Of_Dead_Text\\C_Guide_Of_Dead_Text.spr");
particle->SetAction("이팩트\\C_Guide_Of_Dead_Text\\C_Guide_Of_Dead_Text.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 12.0f;
break;
case EF_UNK_2431:
particle->SetSprite("이팩트\\C_Medjed_Text\\C_Medjed_Text.spr");
particle->SetAction("이팩트\\C_Medjed_Text\\C_Medjed_Text.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 12.0f;
break;
case EF_UNK_2428:
particle->SetSprite("이팩트\\Atque_Poenitentia\\Atque_Poenitentia.spr");
particle->SetAction("이팩트\\Atque_Poenitentia\\Atque_Poenitentia.act");
particle->loopMode = 0;
particle->depthOffset = 0.001f;
particle->frameDelay = 4.0f;
particle->flags = 0xD;
break;
case EF_UNK_2429:
particle->SetSprite("이팩트\\Perm_Frost_Oblivion\\Perm_Frost_Oblivion.spr");
particle->SetAction("이팩트\\Perm_Frost_Oblivion\\Perm_Frost_Oblivion.act");
particle->depthOffset = 0.001f;
particle->frameDelay = 4.0f;
particle->loopMode = 0;
particle->flags = 1;
break;
case EF_UNK_2458:
particle->SetSprite("이팩트\\S_Beelzebub_Wing\\S_Beelzebub_Wing.spr");
particle->SetAction("이팩트\\S_Beelzebub_Wing\\S_Beelzebub_Wing.act");
particle->flags = 1;
particle->depthOffset = 0.0015f;
particle->loopMode = 0;
particle->frameDelay = 8.0f;
break;
case EF_UNK_2443: {
const char spriteSource[] = {'\x99', '\x4B', '\xC5', '\xAC', '\x93', '\x65', '\x7B', '\x98', '\x06', '\xB5', '\x33', '\x4F', '\x60',
'\x99', '\x48', '\xA8', '\x1F', '\xE2', '\x70', '\x09', '\x34', '\xE5', '\x54', '\xAB', '\x2B', '\x87'};
particle->SetSprite(DecryptName<0xDB27CB557D038759ULL>(spriteSource));
const char actionSource[] = {'\x4D', '\x71', '\x7D', '\xB2', '\x71', '\x97', '\xE7', '\x12', '\xD2', '\x8F', '\x8B', '\x51', '\x82',
'\x6B', '\xD4', '\x22', '\xCB', '\xD8', '\xC8', '\x17', '\xD6', '\x17', '\xDA', '\x32', '\xF9', '\xBD'};
particle->SetAction(DecryptName<0x51BB39B763BBBD8DULL>(actionSource));
particle->flags = 1;
particle->depthOffset = 0.0015f;
particle->loopMode = 0;
particle->frameDelay = 8.0f;
break;
}
}
}
// OFFSET: 0x00B79C40
// FUNCTION: fn_19201
void CSpriteEffect::Render() {
for (auto it = this->particles.begin(); it != this->particles.end(); ++it) {
CSpriteParticle* particle = *it;
if (particle->elapsedFrames > 0) {
particle->Draw(1);
}
}
}
// OFFSET: 0x00B79520
// FUNCTION: fn_19199
bool CSpriteEffect::IsAlive() {
switch (this->id) {
case EF_GROUND_EXPLOSION:
return !this->IsFinished();
case EF_UNK_1192: {
if (this->actor == 0) {
return false;
}
if (!g_modeMgr.GetGameMode()) {
return false;
}
CWorld* scene = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->scene;
if (!scene) {
return false;
}
if (!scene->GetItemByAID(this->actor)) {
return false;
}
return true;
}
case EF_UNK_1130:
case EF_UNK_1151:
case EF_UNK_1152:
case EF_UNK_1153:
case EF_UNK_1154:
case EF_UNK_1155:
case EF_UNK_1156:
case EF_UNK_1157:
case EF_UNK_1158:
case EF_UNK_1159:
case EF_UNK_1160:
case EF_UNK_1211:
case EF_UNK_1212:
case EF_UNK_1213:
case EF_UNK_1377:
case EF_UNK_1419:
case EF_UNK_1617:
case EF_UNK_1618:
case EF_UNK_1619:
case EF_UNK_2394:
case EF_UNK_2424:
case EF_UNK_2428:
case EF_UNK_2429:
case EF_UNK_2430:
case EF_UNK_2431:
case EF_UNK_2443:
case EF_UNK_2458:
return this->ActorExists();
}
for (CSpriteParticle* particle : this->particles) {
if (particle->life == 0.0f) {
return true;
}
if (particle->life * 60.0f > static_cast<float>(particle->elapsedFrames)) {
return true;
}
}
return false;
}
// OFFSET: 0x00B79780
// FUNCTION: fn_19200
void CSpriteEffect::OnProcess() {
for (auto it = this->particles.begin(); it != this->particles.end(); ++it) {
CSpriteParticle* particle = *it;
++particle->elapsedFrames;
switch (this->id) {
case EF_UNK_1130: {
int height = 8;
if (CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor))) {
height = static_cast<int>(actor->GetNameOffset() + 8.0f);
}
particle->position.x = this->position[0];
particle->position.y = this->position[1] - static_cast<float>(height);
particle->position.z = this->position[2];
break;
}
case EF_UNK_1147:
case EF_UNK_1192:
particle->position.x = this->position[0];
particle->position.y = this->position[1] - 10.0f;
particle->position.z = this->position[2];
break;
case EF_UNK_1151:
case EF_UNK_1152:
case EF_UNK_1153:
case EF_UNK_1154:
case EF_UNK_1155:
case EF_UNK_1156:
case EF_UNK_1157:
case EF_UNK_1158:
case EF_UNK_1159:
case EF_UNK_1160: {
int height = 25;
if (CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor))) {
height = static_cast<int>(actor->GetNameOffset() + 25.0f);
}
particle->position.x = this->position[0];
particle->position.y = this->position[1] - static_cast<float>(height);
particle->position.z = this->position[2];
break;
}
case EF_UNK_1211:
case EF_UNK_1212:
case EF_UNK_1213: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const int height = static_cast<int>(actor->GetNameOffset() + 8.0f);
particle->position.x = this->position[0];
particle->position.y = this->position[1] - static_cast<float>(height);
particle->position.z = this->position[2];
break;
}
case EF_UNK_1377: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const int height = static_cast<int>(actor->GetNameOffset() + 3.0f);
particle->position.x = this->position[0];
particle->position.y = this->position[1] - static_cast<float>(height);
particle->position.z = this->position[2];
break;
}
case EF_UNK_2394:
case EF_UNK_2424: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const int height = static_cast<int>(actor->GetNameOffset());
particle->position.x = this->position[0];
particle->position.y = this->position[1] - static_cast<float>(height);
particle->position.z = this->position[2];
break;
}
case EF_UNK_2428: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const float height = actor->GetNameOffset();
const float offset = g_session.IsDoramJob(actor->GetEffectiveJob(-1)) ? height + 13.7f : height + 17.0f;
particle->position.x = this->position[0];
particle->position.y = this->position[1] - offset;
particle->position.z = this->position[2];
break;
}
case EF_UNK_2429: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const float offset = g_session.IsDoramJob(actor->GetEffectiveJob(-1)) ? 2.2f : 0.4f;
particle->position.x = this->position[0];
particle->position.y = this->position[1] - offset;
particle->position.z = this->position[2];
break;
}
case EF_UNK_2430:
case EF_UNK_2431: {
CGameActor* actor = static_cast<CGameActor*>(FindRenderObject(this->actor));
if (!actor) {
break;
}
const float height = actor->GetNameOffset();
particle->position.x = this->position[0];
particle->position.y = this->position[1] - height;
particle->position.z = this->position[2];
break;
}
case EF_UNK_2443:
particle->applyActorExtent = 1;
particle->applyActorLift = 1;
particle->screenOffsetY = 0.0f;
particle->screenOffsetX = 0.0f;
particle->position.x = this->position[0];
particle->position.y = this->position[1];
particle->position.z = this->position[2];
break;
case EF_UNK_2458:
particle->applyActorExtent = 1;
particle->applyActorLift = 1;
particle->screenOffsetY = -105.0f;
particle->screenOffsetX = 0.0f;
particle->position.x = this->position[0];
particle->position.y = this->position[1];
particle->position.z = this->position[2];
break;
default:
particle->position.x = this->position[0];
particle->position.y = this->position[1];
particle->position.z = this->position[2];
break;
}
}
}