From 31c5b3dd9b2c807f0d7edcdea7eef9b3a6a2d18b Mon Sep 17 00:00:00 2001 From: shenlei Date: Tue, 13 Oct 2026 21:50:50 +0900 Subject: [PATCH] Net: show damage numbers through the actor damage queue Port CInstanceBase::AddDamageEffect/ProcessDamage: damage packets queue per actor and show one digit-effect burst per update, dodge/block show the miss effect. Add CEffectManager::SetEffectTextures and CFlyingManager::CreateIndexedFly for the indexed fly types, and reset the damage target on GC_PHASE loading. Co-Authored-By: Claude Haiku 5.5 --- src/eter_effect/EffectData.cpp | 8 ++ src/eter_effect/EffectData.h | 3 + src/eter_effect/EffectInstance.cpp | 12 +-- src/eter_effect/EffectInstance.h | 3 + src/eter_effect/EffectManager.cpp | 6 ++ src/eter_effect/EffectManager.h | 3 + src/eter_effect/FlyingManager.cpp | 34 ++++++++ src/eter_effect/FlyingManager.h | 4 + src/eter_net/NetworkActorManager.cpp | 78 +++++++++++++++++++ src/eter_net/NetworkActorManager.h | 13 ++++ src/eter_net/PythonNetworkStream.cpp | 60 ++++---------- src/eter_net/PythonNetworkStream.h | 8 +- .../PythonNetworkStreamPhaseGameRecv.cpp | 1 + 13 files changed, 178 insertions(+), 55 deletions(-) diff --git a/src/eter_effect/EffectData.cpp b/src/eter_effect/EffectData.cpp index 130e068b..ce89bfe3 100644 --- a/src/eter_effect/EffectData.cpp +++ b/src/eter_effect/EffectData.cpp @@ -51,6 +51,14 @@ static std::string NormalizePath(std::string path) { return path; } +bool EffectData::ChangeTexture(size_t particleIndex, const std::string& fileName) { + if (particleIndex >= m_particles.size()) return false; + auto& textures = m_particles[particleIndex].particle.texture_files; + if (textures.size() > 1) return false; + textures.assign(1, NormalizePath(fileName)); + return true; +} + static std::vector TokenizeScript(const std::string& content) { std::vector tokens; size_t i = 0; diff --git a/src/eter_effect/EffectData.h b/src/eter_effect/EffectData.h index 021a5d47..824491a2 100644 --- a/src/eter_effect/EffectData.h +++ b/src/eter_effect/EffectData.h @@ -87,6 +87,9 @@ public: const float* GetBoundingSpherePosition() const { return m_bounding_sphere_position; } const std::vector& GetParticles() const { return m_particles; } const std::string& GetSoundFileName() const { return m_sound_filename; } + // CParticleSystemData::ChangeTexture -> CParticleProperty::SetTexture: replaces a single-texture + // particle's image (false for animated multi-texture particles or a missing particle). + bool ChangeTexture(size_t particleIndex, const std::string& fileName); private: std::string m_filename; diff --git a/src/eter_effect/EffectInstance.cpp b/src/eter_effect/EffectInstance.cpp index f09ad72c..8fba3933 100644 --- a/src/eter_effect/EffectInstance.cpp +++ b/src/eter_effect/EffectInstance.cpp @@ -16,6 +16,7 @@ EffectInstance::EffectInstance(std::shared_ptr data) : m_data(std::move(data)) { if (m_data) { m_emitters.resize(m_data->GetParticles().size()); + for (const auto& pe : m_data->GetParticles()) m_textures.push_back(pe.particle.texture_files); } } @@ -204,8 +205,8 @@ void EffectInstance::Update(float dt) { it->scale[1] = InterpolateTimeEvent(pe.particle.time_scale_y, t, 1.0f); // Texture animation - if (pe.particle.texture_files.size() > 1 && pe.particle.tex_ani_delay > 0.001f) { - it->frame_index = static_cast(std::fmod(it->life / pe.particle.tex_ani_delay, pe.particle.texture_files.size())); + if (m_textures[i].size() > 1 && pe.particle.tex_ani_delay > 0.001f) { + it->frame_index = static_cast(std::fmod(it->life / pe.particle.tex_ani_delay, m_textures[i].size())); } ++it; @@ -250,9 +251,10 @@ void EffectInstance::BuildDrawCommands(const float* viewMatrix, const float* pro for (size_t pIdx = 0; pIdx < inst.particles.size(); ++pIdx) { const auto& p = inst.particles[pIdx]; std::string tex = ""; - if (!pe.particle.texture_files.empty()) { - size_t frame = p.frame_index % pe.particle.texture_files.size(); - tex = pe.particle.texture_files[frame]; + const auto& textures = m_textures[i]; + if (!textures.empty()) { + size_t frame = p.frame_index % textures.size(); + tex = textures[frame]; } texGroups[tex].push_back(pIdx); } diff --git a/src/eter_effect/EffectInstance.h b/src/eter_effect/EffectInstance.h index 31bf8933..34b21103 100644 --- a/src/eter_effect/EffectInstance.h +++ b/src/eter_effect/EffectInstance.h @@ -60,6 +60,9 @@ private: bool m_hasCustomMatrix = false; std::vector m_emitters; + // CParticleSystemInstance m_kVct_pkImgInst: the texture list is taken when the instance is created, + // so CEffectManager::SetEffectTextures only affects instances created after it. + std::vector> m_textures; }; } // namespace ava2 diff --git a/src/eter_effect/EffectManager.cpp b/src/eter_effect/EffectManager.cpp index 2be97a1f..33d82de3 100644 --- a/src/eter_effect/EffectManager.cpp +++ b/src/eter_effect/EffectManager.cpp @@ -64,6 +64,12 @@ uint32_t EffectManager::CreateEffect(uint32_t effectId, float x, float y, float return instId; } +void EffectManager::SetEffectTextures(uint32_t effectId, const std::vector& textures) { + auto it = m_dataCache.find(effectId); + if (it == m_dataCache.end() || !it->second) return; // Tracef("... - NO DATA") + for (size_t i = 0; i < textures.size(); ++i) it->second->ChangeTexture(i, textures[i]); +} + bool EffectManager::DestroyEffectInstance(uint32_t instanceId) { auto it = m_instances.find(instanceId); if (it != m_instances.end()) { diff --git a/src/eter_effect/EffectManager.h b/src/eter_effect/EffectManager.h index 4af9a8dd..0d152ada 100644 --- a/src/eter_effect/EffectManager.h +++ b/src/eter_effect/EffectManager.h @@ -18,6 +18,9 @@ public: uint32_t CreateEffect(const std::string& filename, float x = 0.0f, float y = 0.0f, float z = 0.0f, float yaw = 0.0f); uint32_t CreateEffect(uint32_t effectId, float x = 0.0f, float y = 0.0f, float z = 0.0f, float yaw = 0.0f); + // CEffectManager::SetEffectTextures: texture i replaces particle i's image in the shared data. + void SetEffectTextures(uint32_t effectId, const std::vector& textures); + bool DestroyEffectInstance(uint32_t instanceId); void DeleteAllInstances(); bool IsAliveEffect(uint32_t instanceId) const; diff --git a/src/eter_effect/FlyingManager.cpp b/src/eter_effect/FlyingManager.cpp index dc537ddc..0e253915 100644 --- a/src/eter_effect/FlyingManager.cpp +++ b/src/eter_effect/FlyingManager.cpp @@ -1,5 +1,7 @@ #include "FlyingManager.h" +#include #include +#include #include #include #include @@ -335,6 +337,38 @@ uint32_t FlyingManager::CreateFlyingInstance(uint32_t flyId, const float* startP return static_cast(m_instances.size()); } +void FlyingManager::CreateIndexedFly(uint32_t index, const float* startPos, float startRotation, const float* endTargetPos) { + auto it = m_indexedFlyData.find(index); + if (it == m_indexedFlyData.end()) { + std::cerr << "[AVA2 TraceError] CFlyingManager::CreateIndexedFly(dwIndex=" << index << ") - Not registered index" << std::endl; + return; + } + auto frandom = [](float lo, float hi) { return lo + (hi - lo) * (static_cast(std::rand()) / static_cast(RAND_MAX)); }; + switch (it->second.type) { + case INDEX_FLY_TYPE_NORMAL: + CreateFlyingInstance(it->second.flyId, startPos, endTargetPos); + break; + case INDEX_FLY_TYPE_FIRE_CRACKER: { + constexpr float DEG = 3.14159265358979323846f / 180.0f; + const float fRot = std::fmod(startRotation - 90.0f + 360.0f, 360.0f) + frandom(-30.0f, 30.0f); + const float fDistance = frandom(2000.0f, 5000.0f); + const float fxRand = fDistance * std::cos(fRot * DEG); + const float fyRand = fDistance * std::sin(fRot * DEG); + const float fzRand = frandom(1000.0f, 2500.0f); + // Native (x, y, z) = engine (x, -z, height). + const float start[3] = {startPos[0], startPos[1] + 200.0f, startPos[2]}; + const float end[3] = {startPos[0] + fxRand, startPos[1] + fzRand, startPos[2] - fyRand}; + CreateFlyingInstance(it->second.flyId, start, end); + break; + } + case INDEX_FLY_TYPE_AUTO_FIRE: { + const float start[3] = {startPos[0], startPos[1] + 100.0f, startPos[2]}; + CreateFlyingInstance(it->second.flyId, start, endTargetPos); + break; + } + } +} + void FlyingManager::Update(float dt, float currentTime) { for (auto it = m_instances.begin(); it != m_instances.end();) { if (!(*it)->Update(dt, currentTime)) { diff --git a/src/eter_effect/FlyingManager.h b/src/eter_effect/FlyingManager.h index 10a1aedc..613038b9 100644 --- a/src/eter_effect/FlyingManager.h +++ b/src/eter_effect/FlyingManager.h @@ -105,6 +105,10 @@ public: uint32_t CreateFlyingInstance(uint32_t flyId, const float* startPos, const float* targetPos, std::function hitCb = nullptr); uint32_t CreateFlyingInstance(const std::string& filename, const float* startPos, const float* targetPos, std::function hitCb = nullptr); + // CFlyingManager::CreateIndexedFly: start = the start actor's position (engine x, height, z) and + // rotation (native degrees), end = the end actor's fly-target position. + void CreateIndexedFly(uint32_t index, const float* startPos, float startRotation, const float* endTargetPos); + void Update(float dt, float currentTime); void BuildDrawCommands(const float* viewMatrix, const float* projMatrix, float currentTime, std::vector& outDraws); void DeleteAllInstances(); diff --git a/src/eter_net/NetworkActorManager.cpp b/src/eter_net/NetworkActorManager.cpp index e021e4fe..34ed7676 100644 --- a/src/eter_net/NetworkActorManager.cpp +++ b/src/eter_net/NetworkActorManager.cpp @@ -3,6 +3,7 @@ #include "eter_effect/EffectManager.h" #include "nonplayer_data.h" #include "eter_render/RaceData.h" +#include "eter_render/Gr2ModelRenderer.h" #include #include #include @@ -241,6 +242,82 @@ void NetworkActorManager::CreateSpecialEffect(uint32_t vid, unsigned type) { EffectManager::Instance().CreateEffect(GetEffectCRC(type), x, y, z, yaw); } +void NetworkActorManager::AddDamageEffect(uint32_t vid, uint32_t damage, uint8_t flag, bool bSelf, bool bTarget) { + auto* actor = GetActorData(vid); + if (!actor) return; // the caller checks CPythonSystem::IsShowDamage (eter_render has no scripting) + actor->m_DamageQueue.push_back({damage, flag, bSelf, bTarget}); +} + +namespace { + +// CInstanceBase::ProcessDamage. The camera comes from the current scene renderer: its view matrix +// rows are the camera axes in engine space (x right, z forward); native (x, y) = engine (x, -z). +void ProcessDamage(SNetworkActorData& actor) { + if (actor.m_DamageQueue.empty() || !actor.m_pActorInstance) return; + const auto sDamage = actor.m_DamageQueue.front(); + actor.m_DamageQueue.pop_front(); + + uint32_t damage = sDamage.damage; + const uint8_t flag = sDamage.flag; + + float rightX = 1.0f, rightY = 0.0f, rightZ = 0.0f, cameraAngle = 0.0f; + if (const auto* renderer = TextTailManager::Instance().GetCurrentSceneRenderer()) { + const float* view = renderer->GetViewMatrix(); + rightX = view[0]; rightY = view[4]; rightZ = view[8]; + // GetDegreeFromPosition2(target, eye): the native direction from the camera target to the eye. + const float dirX = -view[2], dirY = view[10]; + const float len = std::sqrt(dirX * dirX + dirY * dirY); + if (len > 0.0f) { + cameraAngle = std::acos(std::clamp(-dirY / len, -1.0f, 1.0f)) * 180.0f / 3.14159265358979323846f; + if (dirX < 0.0f) cameraAngle = 360.0f - cameraAngle; + } + } + + constexpr float FONT_WIDTH = 30.0f; + auto& rkEftMgr = EffectManager::Instance(); + float x, y, z; + actor.m_pActorInstance->GetHeadPosition(x, y, z); // GetPosition() + GetHeight() + + if ((flag & NetworkActorManager::DAMAGE_DODGE) || (flag & NetworkActorManager::DAMAGE_BLOCK)) { + rkEftMgr.CreateEffect(NetworkActorManager::GetEffectCRC(sDamage.bSelf ? NetworkActorManager::EFFECT_DAMAGE_MISS + : NetworkActorManager::EFFECT_DAMAGE_TARGETMISS), + x, y, z, cameraAngle); + return; + } + // DAMAGE_CRITICAL: the critical effect is commented out upstream; the number is still shown. + + std::string strDamageType; + unsigned rdwCRCEft = 0; + if (sDamage.bSelf) { + strDamageType = "damage_"; + rdwCRCEft = actor.m_bDamageEffectType ? NetworkActorManager::EFFECT_DAMAGE_SELFDAMAGE2 : NetworkActorManager::EFFECT_DAMAGE_SELFDAMAGE; + actor.m_bDamageEffectType = !actor.m_bDamageEffectType; + } else if (!sDamage.bTarget) { + return; // "nontarget_" / EFFECT_DAMAGE_NOT_TARGET: not applied upstream. + } else { + strDamageType = "target_"; + rdwCRCEft = NetworkActorManager::EFFECT_DAMAGE_TARGET; + } + + const uint32_t effectId = NetworkActorManager::GetEffectCRC(rdwCRCEft); + uint32_t index = 0; + while (damage > 0) { + if (index > 7) { + std::cerr << "[AVA2 TraceError] ProcessDamage Possibility of endless loop" << std::endl; + break; + } + const uint32_t num = damage % 10; + damage /= 10; + rkEftMgr.SetEffectTextures(effectId, {"d:/ymir work/effect/affect/damagevalue/" + strDamageType + std::to_string(num) + ".dds"}); + // Translation by (-FONT_WIDTH * index, 0, 0) in view space. + const float offset = -FONT_WIDTH * static_cast(index); + rkEftMgr.CreateEffect(effectId, x + rightX * offset, y + rightY * offset, z + rightZ * offset, cameraAngle); + ++index; + } +} + +} // namespace + bool NetworkActorManager::IsPossibleEmoticon(uint32_t vid) const { const auto* actor = GetActorData(vid); if (!actor) return false; @@ -855,6 +932,7 @@ void NetworkActorManager::Update(float dt, const TerrainHeightSource* terrain) { eftMgr.SetEffectInstanceRotation(e->instanceId, inst.GetYaw(), 0.0f, 0.0f); ++e; } + ProcessDamage(actorData); } } diff --git a/src/eter_net/NetworkActorManager.h b/src/eter_net/NetworkActorManager.h index 3ae2ad57..2f9b2783 100644 --- a/src/eter_net/NetworkActorManager.h +++ b/src/eter_net/NetworkActorManager.h @@ -7,6 +7,7 @@ #include #include #include +#include #include namespace ava2 { @@ -80,6 +81,10 @@ struct SNetworkActorData { // packet copies above (SetHair/SetSash/SetWeapon may refuse a value the packet carried). uint32_t m_awPart[7] = {}; std::vector m_attachedEffects; + // CInstanceBase::SEffectDamage / m_DamageQueue / m_bDamageEffectType (AddDamageEffect, ProcessDamage). + struct SEffectDamage { uint32_t damage = 0; uint8_t flag = 0; bool bSelf = false; bool bTarget = false; }; + std::deque m_DamageQueue; + bool m_bDamageEffectType = false; // CInstanceBase::m_adwCRCAffectEffect[AFFECT_NUM]: the effect instance __SetAffect attached. uint32_t m_adwAffectEffect[64] = {}; // CGraphicThingInstance::Hide/Show (chr.Hide/chr.Show); hidden instances are not drawn. @@ -189,6 +194,14 @@ public: void CreateSpecialEffect(uint32_t vid, unsigned type); // effect at the actor transform bool IsPossibleEmoticon(uint32_t vid) const; void SetEmoticon(uint32_t vid, unsigned emoticon); + // CInstanceBase::AddDamageEffect (the caller checks CPythonSystem::IsShowDamage) and ProcessDamage, + // which shows one queued entry per update as damagevalue digit effects. + enum { DAMAGE_DODGE = 1 << 2, DAMAGE_BLOCK = 1 << 3, DAMAGE_CRITICAL = 1 << 5 }; + enum { + EFFECT_DAMAGE_TARGET = 254, EFFECT_DAMAGE_NOT_TARGET, EFFECT_DAMAGE_SELFDAMAGE, EFFECT_DAMAGE_SELFDAMAGE2, + EFFECT_DAMAGE_POISON, EFFECT_DAMAGE_MISS, EFFECT_DAMAGE_TARGETMISS, EFFECT_DAMAGE_CRITICAL, + }; + void AddDamageEffect(uint32_t vid, uint32_t damage, uint8_t flag, bool bSelf, bool bTarget); void SetTimeSourceForTest(uint32_t (*now)()) { m_now = now; } // CInstanceBase name/title colour tables (InstanceBaseEffect.cpp g_akD3DXClrName/Title, diff --git a/src/eter_net/PythonNetworkStream.cpp b/src/eter_net/PythonNetworkStream.cpp index 03eb9d56..dc556f84 100644 --- a/src/eter_net/PythonNetworkStream.cpp +++ b/src/eter_net/PythonNetworkStream.cpp @@ -9,14 +9,13 @@ #include "shared/common/PythonUtils.h" #include "nonplayer_data.h" #include "python_app.h" +#include "python_system.h" #include "python_gameplay_modules.h" #include "python_chat.h" #include "python_native_modules.h" #include "PythonExchange.h" #include "PythonSafeBox.h" -#include "eter_render/FloatingTextManager.h" #include "eter_render/TextTailManager.h" -#include "eter_sound/SoundManager.h" #include "eter_effect/EffectManager.h" #include "eter_effect/FlyingManager.h" #include @@ -465,6 +464,7 @@ bool PythonNetworkStream::RecvPhasePacket() { break; case PHASE_LOADING: // SetLoadingPhase: CPythonPlayer::Clear ResetPlayerState(); + m_dwInstTargetVID=0; // the instances it named are gone (CPythonCharacterManager::DeleteAllInstances) SetPhase(PHASE_LOADING); break; case PHASE_GAME: // SetGamePhase: __RefreshStatus @@ -875,27 +875,15 @@ bool PythonNetworkStream::RecvDamageInfoPacket() { TPacketGCDamageInfo p; if (!Read(sizeof(p), &p)) return false; - auto actor = NetworkActorManager::Instance().GetActorInstance(p.dwVID); - float ax = 0.0f, ay = 0.0f, az = 0.0f; - if (actor) { - ax = actor->GetX(); - ay = actor->GetY(); - az = actor->GetZ(); - actor->TakeDamage(p.damage); - } - - // Spawn 3D floating damage number above target head - bool isCritical = (p.flag & 1) != 0; - FloatingTextManager::Instance().AddDamage(p.damage, ax, ay + 140.0f, az, isCritical, true); - - // Hit particle sparks - EffectManager::Instance().CreateEffect("ymir work/pc/warrior/effect/gihyeol_spark.mse", ax, ay + 70.0f, az); - - // SFX - SoundManager::Instance().PlaySound2D("sound/ui/punch.wav"); - - if (m_damageCallback) { - m_damageCallback(p.dwVID, p.damage, p.flag); + auto& chrMgr = NetworkActorManager::Instance(); + const bool bSelf = p.dwVID == chrMgr.GetMainActorVID(); + const bool bTarget = p.dwVID == m_dwInstTargetVID; + if (chrMgr.GetActorData(p.dwVID)) { + if (p.damage >= 0) { + if (CPythonSystem::Instance().IsShowDamage()) // CInstanceBase::AddDamageEffect + chrMgr.AddDamageEffect(p.dwVID, uint32_t(p.damage), p.flag, bSelf, bTarget); + } else + std::cerr << "[AVA2 TraceError] Damage is equal or below 0." << std::endl; } return true; } @@ -1058,28 +1046,12 @@ bool PythonNetworkStream::RecvCreateFlyPacket() { auto startActor = NetworkActorManager::Instance().GetActorInstance(p.dwStartVID); auto endActor = NetworkActorManager::Instance().GetActorInstance(p.dwEndVID); + if (!startActor || !endActor) return true; - float startPos[3] = {0.0f, 100.0f, 0.0f}; - float endPos[3] = {200.0f, 100.0f, 0.0f}; - - if (startActor) { - startPos[0] = startActor->GetX(); - startPos[1] = startActor->GetY() + 60.0f; - startPos[2] = startActor->GetZ(); - } - if (endActor) { - endPos[0] = endActor->GetX(); - endPos[1] = endActor->GetY() + 60.0f; - endPos[2] = endActor->GetZ(); - } - - FlyingManager::Instance().CreateFlyingInstance(p.bType, startPos, endPos, [endVID = p.dwEndVID](const float* hitPos) { - EffectManager::Instance().CreateEffect("ymir work/pc/warrior/effect/gihyeol_spark.mse", hitPos[0], hitPos[1], hitPos[2]); - }); - - if (m_flyCallback) { - m_flyCallback(p.bType, p.dwStartVID, p.dwEndVID); - } + const float startPos[3] = {startActor->GetX(), startActor->GetY(), startActor->GetZ()}; + float endPos[3]; + endActor->GetFlyTargetCenter(endPos); + FlyingManager::Instance().CreateIndexedFly(p.bType, startPos, startActor->GetYaw(), endPos); return true; } diff --git a/src/eter_net/PythonNetworkStream.h b/src/eter_net/PythonNetworkStream.h index e117a622..de86162d 100644 --- a/src/eter_net/PythonNetworkStream.h +++ b/src/eter_net/PythonNetworkStream.h @@ -177,8 +177,6 @@ public: std::pair GetDungeonDestination() const { return m_dungeonDestination; } // Callback when damage occurs - using DamageCallback = std::function; - void SetDamageCallback(DamageCallback cb) { m_damageCallback = cb; } // Callback when chat is received @@ -213,8 +211,6 @@ public: void SetGroundItemCallback(GroundItemCallback cb) { m_groundItemCallback = cb; } // Callback when fly projectile is created - using FlyCallback = std::function; - void SetFlyCallback(FlyCallback cb) { m_flyCallback = cb; } // GC_WARP: the transport (LoginClient::warp) performs CNetworkStream::Connect(lAddr, wPort). bool TakeWarpRequest(uint32_t& address,uint16_t& port) { @@ -425,10 +421,10 @@ private: // Temporary pending actor data when CharacterAdd arrives before CharacterAdditionalInfo SNetworkActorData m_pendingActorData; - DamageCallback m_damageCallback; + // m_pInstTarget (RecvTargetPacket): RecvDamageInfoPacket shows "target_" numbers only for it. + uint32_t m_dwInstTargetVID = 0; WhisperCallback m_whisperCallback; GroundItemCallback m_groundItemCallback; - FlyCallback m_flyCallback; }; } // namespace ava2 diff --git a/src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp b/src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp index 4f9dbf9d..160f1c0f 100644 --- a/src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp +++ b/src/eter_net/PythonNetworkStreamPhaseGameRecv.cpp @@ -598,6 +598,7 @@ bool PythonNetworkStream::RecvTargetInfoPacket() { PyCallClassMemberFunc(game,"BINARY_AddTargetMonsterDropInfo",Py_BuildValue("(iii)",int(p.race),int(p.dwVnum),int(p.count))); PyCallClassMemberFunc(game,"BINARY_RefreshTargetMonsterDropInfo",Py_BuildValue("(i)",int(p.race))); } else PyCallClassMemberFunc(game,"CloseTargetBoard",Py_BuildValue("()")); + m_dwInstTargetVID=p.dwVID; } } else PyCallClassMemberFunc(game,"CloseTargetBoard",Py_BuildValue("()")); return true;