//------------------------------------------------------------------------- public void s2allcManualFire(int bullet_objid, float turret_angle, int turret_rate, int locked_fish_id) { bool is_me = (mScene.getMyPlayerId() == mPlayer.et_player_rpcid); if (!is_me) { mTurretAngle = turret_angle; mTurretRate = turret_rate; mBulletFirePos = mTurretPos + CLogicUtility.getDirection(mTurretAngle).normalized *mBarrelOffset; mCSpriteTurretShow.fireAt(mTurretAngle); int bullet_vibid = mVibTurret.BulletDataKey.Id; CRenderBullet bullet = new CRenderBullet(mScene); bullet.create(mPlayer.et_player_rpcid, bullet_objid, bullet_vibid, CBulletConstant.ManualSpeed, locked_fish_id, mBulletFirePos, mTurretAngle, mVibTurret.HitFishParticleDataKey); //int vib_compose_data_id = getVibTurret().EffectComposeFire.Data.ID; //mScene.addEffect(vib_compose_data_id, new Dictionary<string, object>(), EffectTypeEnum.Client); mScene.getListener().onSceneFire(mPlayer.et_player_rpcid, getPlayerGold()); } else { mfIdleSecond = 0.0f; mfObCountdown = 60.0f; } }
//------------------------------------------------------------------------- public void doOtherFire(int bullet_objid, float bullet_speed) { mBulletFirePos = mTurretPos + CLogicUtility.getDirection(mTurretAngle).normalized *mBarrelOffset; mCSpriteTurretShow.fireAt(mTurretAngle); int bullet_vibid = mVibTurret.BulletDataKey.Id; CRenderBullet bullet = new CRenderBullet(mScene); bullet.create(mPlayer.et_player_rpcid, bullet_objid, bullet_vibid, bullet_speed, _getLockedFishIdFromLockedBuffer(), mBulletFirePos, mTurretAngle, mVibTurret.HitFishParticleDataKey); mScene.getListener().onSceneFire(mPlayer.et_player_rpcid, getPlayerGold()); }
//------------------------------------------------------------------------- public void s2allcEfxFire(int bullet_vibid, int bullet_objid, float level_cur_second, float turret_angle, int turret_rate, EbVector3 pos) { //bool is_me = (mScene.getMyPlayerId() == mPlayer.player_entityid); //if (!is_me) { mTurretAngle = turret_angle; mTurretRate = turret_rate; mBulletFirePos = pos; mCSpriteTurretShow.aimAt(mTurretAngle); CRenderBullet bullet = new CRenderBullet(mScene); bullet.create(mPlayer.et_player_rpcid, bullet_objid, bullet_vibid, CBulletConstant.ManualSpeed, _getLockedFishIdFromLockedBuffer(), mBulletFirePos, turret_angle, mVibTurret.HitFishParticleDataKey); } }
//------------------------------------------------------------------------- public void doLocalFire(int bullet_objid, float bullet_speed) { mBulletFirePos = mTurretPos + CLogicUtility.getDirection(mTurretAngle).normalized *mBarrelOffset; mCSpriteTurretShow.fireAt(mTurretAngle); int bullet_vibid = mVibTurret.BulletDataKey.Id; CRenderBullet bullet = new CRenderBullet(mScene); bullet.create(mPlayer.et_player_rpcid, bullet_objid, bullet_vibid, bullet_speed, _getLockedFishIdFromLockedBuffer(), mBulletFirePos, mTurretAngle, mVibTurret.HitFishParticleDataKey); int vib_compose_data_id = getVibTurret().EffectComposeFire.Id; mScene.addEffect(vib_compose_data_id, new Dictionary <string, object>(), EffectTypeEnum.Client); mScene.getListener().onSceneFire(mPlayer.et_player_rpcid, getPlayerGold()); }
//------------------------------------------------------------------------- public void addBullet(CRenderBullet bullet) { if (mMapBullet.ContainsKey(bullet.getPlayerId())) { Dictionary <int, CRenderBullet> m = mMapBullet[bullet.getPlayerId()]; if (m.ContainsKey(bullet.getBulletObjId())) { m[bullet.getBulletObjId()].Dispose(); m.Remove(bullet.getBulletObjId()); } m[bullet.getBulletObjId()] = bullet; } else { Dictionary <int, CRenderBullet> m = new Dictionary <int, CRenderBullet>(); m[bullet.getBulletObjId()] = bullet; mMapBullet[bullet.getPlayerId()] = m; } }