Example #1
0
        //-------------------------------------------------------------------------
        public override void load(EbPropSet prop_set)
        {
            Name = prop_set.getPropString("T_Name").get();
            var prop_state = prop_set.getPropInt("I_State");

            State = prop_state == null ? DataState.Default : (DataState)prop_state.get();
            TurretBasePixelHeight        = prop_set.getPropInt("I_TurretBasePixelHeight").get();
            TurretBaseHeight             = prop_set.getPropInt("I_TurretBaseHeight").get();
            TurretBaseAnimationName      = prop_set.getPropString("T_TurretBaseAnimationName").get();
            TurretBarrelPixelHeight      = prop_set.getPropInt("I_TurretBarrelPixelHeight").get();
            TurretBarrelHeight           = prop_set.getPropInt("I_TurretBarrelHeight").get();
            TurretBarrelAnimationName    = prop_set.getPropString("T_TurretBarrelAnimationName").get();
            TurretTopCoverPixelHeight    = prop_set.getPropInt("I_TurretTopCoverPixelHeight").get();
            TurretTopCoverHeight         = prop_set.getPropInt("I_TurretTopCoverHeight").get();
            TurretTopCoverAnimationName  = prop_set.getPropString("T_TurretTopCoverAnimationName").get();
            TurretFireBlazeixelHeight    = prop_set.getPropInt("I_TurretFireBlazeixelHeight").get();
            TurretFireBlazeHeight        = prop_set.getPropInt("I_TurretFireBlazeHeight").get();
            TurretFireBlazeAnimationName = prop_set.getPropString("T_TurretFireBlazeAnimationName").get();

            EffectCompose            = EbDataMgr.Instance.getData <TbDataEffectCompose>(prop_set.getPropInt("I_EffectCompose").get());
            TurretMarginal           = prop_set.getPropInt("I_TurretMarginal").get();
            EffectComposeFire        = EbDataMgr.Instance.getData <TbDataEffectCompose>(prop_set.getPropInt("I_EffectComposeFire").get());
            BulletDataKey            = EbDataMgr.Instance.getData <TbDataBullet>(prop_set.getPropInt("I_BulletDataKey").get());
            FishnetDataKey           = EbDataMgr.Instance.getData <TbDataFishnet>(prop_set.getPropInt("I_FishnetDataKey").get());
            TurretRate               = prop_set.getPropInt("I_TurretRate").get();
            EffectComposeFireNoMoney = EbDataMgr.Instance.getData <TbDataEffectCompose>(prop_set.getPropInt("I_EffectComposeFireNoMoney").get());
            AimParticle              = EbDataMgr.Instance.getData <TbDataParticle>(prop_set.getPropInt("I_AimParticle").get());
            var prop_turrettype = prop_set.getPropInt("I_TurretType");

            mTurretType            = prop_turrettype == null ? TurretType.Default : (TurretType)prop_turrettype.get();
            HitFishParticleDataKey = EbDataMgr.Instance.getData <TbDataParticle>(prop_set.getPropInt("I_HitFishParticleDataKey").get());
        }
Example #2
0
        //-------------------------------------------------------------------------
        public override void load(EbPropSet prop_set)
        {
            var prop_state = prop_set.getPropInt("I_State");

            State        = prop_state == null ? DataState.Default : (DataState)prop_state.get();
            Radius       = prop_set.getPropInt("I_Radius").get();
            ParticleName = EbDataMgr.Instance.getData <TbDataParticle>(prop_set.getPropInt("I_ParticleName").get());
        }
Example #3
0
 //-------------------------------------------------------------------------
 public void displayScoreTurnplate(int score, TbDataParticle particle_data)
 {
     mCSpriteTurretShow.displayScoreTurnplate(score, particle_data);
 }
Example #4
0
        //-------------------------------------------------------------------------
        public void create(uint et_player_rpcid, int bullet_objid, int bullet_vibid, float bullet_speed,
                           int locked_fish_obj_id, EbVector3 turret_pos, float turret_angle, TbDataParticle hit_particle)
        {
            // vib
            mPlayerId        = et_player_rpcid;
            mVibBullet       = EbDataMgr.Instance.getData <TbDataBullet>(bullet_vibid);
            mPos             = turret_pos;
            mfAngle          = turret_angle;
            mBulletObjId     = bullet_objid;
            mLockedFishObjid = locked_fish_obj_id;
            //mfBulletSpeed = mVibBullet.Speed;
            mfBulletSpeed = bullet_speed;

            // sprite bullet
            CRenderTurret turret      = mScene.getTurret(mPlayerId);
            int           turret_id   = turret.getTurretId();
            string        bullet_anim = mVibBullet.Bullet0Animation;

            if (turret.isPower())
            {
                bullet_anim = mVibBullet.ColorBulletAnimation;
            }
            else
            {
                switch (turret_id)
                {
                case 1:
                    bullet_anim = mVibBullet.Bullet1Animation;
                    break;

                case 2:
                    bullet_anim = mVibBullet.Bullet2Animation;
                    break;

                case 3:
                    bullet_anim = mVibBullet.Bullet3Animation;
                    break;

                case 4:
                    bullet_anim = mVibBullet.Bullet4Animation;
                    break;

                case 5:
                    bullet_anim = mVibBullet.Bullet5Animation;
                    break;

                case 6:
                    bullet_anim = mVibBullet.Bullet6Animation;
                    break;
                }
            }
            mBulletAnim   = bullet_anim;
            mSpriteBullet = new CSpriteBullet();
            mSpriteBullet.create(mScene, this, mBulletAnim, hit_particle);
            mSpriteBullet.setTrigger(true, 200);

            mSpriteBullet.setPosition(mPos);
            mSpriteBullet.setDirection(mfAngle);
            mSpriteBullet.setLayer(mScene.getLayerAlloter().getLayer(_eLevelLayer.Bullet));
            mSpriteBullet.setScale((float)mVibBullet.BulletHeight / (float)mVibBullet.BulletPixelHeight);
            mScene.getLevel().addBullet(this);
        }