Example #1
0
        //-------------------------------------------------------------------------
        public override void create(Dictionary <string, object> param)
        {
            base.create(param);
            mSourcePosition = (EbVector3)mMapParam["SourcePosition"];
            TbDataEffectRadiationLighting effect_data = EbDataMgr.Instance.getData <TbDataEffectRadiationLighting>(mEffectId);

            fish_list = mScene.getLevel().getListFishById(effect_data.NormalFish.Id);
            int  current_rate    = (int)mMapParam["Rate"];
            uint et_player_rpcid = (uint)mMapParam["PlayerId"];

            // 销毁一起被连死的鱼
            List <string> custom_param_list = (List <string>)mMapParam["EffectCustomParam"];
            int           effect_fish_vibid = int.Parse(custom_param_list[0]);

            if (effect_fish_vibid != -1)
            {
                List <CRenderFish> fishs = mScene.getLevel().getListFishById(effect_fish_vibid);
                foreach (var f in fishs)
                {
                    f.dieWithRate(et_player_rpcid, current_rate);
                }
            }
        }
        //-------------------------------------------------------------------------
        public override void create(Dictionary <string, object> param)
        {
            mMapParam = param;
            mScene    = mMapParam["LogicScene"] as CLogicScene;
            mPos      = (EbVector3)mMapParam["SourcePosition"];

            uint et_player_rpcid = (uint)mMapParam["PlayerID"];
            int  bullet_rate     = (int)mMapParam["BulletRate"];
            int  die_fish_id     = (int)mMapParam["DieFishObjId"];

            int score = 0;

            TbDataEffectRadiationLighting effect_data = EbDataMgr.Instance.getData <TbDataEffectRadiationLighting>(mEffectId);
            List <CLogicFish>             fish_list   = mScene.getLevel().getListFishById(effect_data.NormalFish.Id);
            int each_fish_score = EbDataMgr.Instance.getData <TbDataFish>(effect_data.NormalFish.Id).FishScore;

            foreach (var n in fish_list)
            {
                score += each_fish_score;
                n.signDestroy();
            }

            // 服务端广播创建特效
            List <string> custom_param_list = new List <string>();

            custom_param_list.Add(effect_data.NormalFish.Id.ToString());

            mScene.getProtocol().s2allcCreateClientEffect(
                et_player_rpcid, bullet_rate, mPos, die_fish_id,
                mEffectId, mEffectName, (int)mEffectType, mDelayTime,
                custom_param_list);

            mReturnValue = new List <object>();
            ReturnValue.Add("Lighting");
            ReturnValue.Add(score);
            ReturnValue.Add(effect_data.NormalFish.Id);
        }