Exemplo n.º 1
0
    public override void Modify(TargetPoint target, float damage)
    {
        WarEntity b = (WarEntity)target.Enemy.Effects.Behaviors.Find(effect => ((WarEntity)effect).name1 == this.GetType().Name + level);

        if (b != null)
        {
            b.age = 0f;
        }
        else
        {
            Corrosion corrosion = Game.SpawnCorrosion();
            corrosion.Initialize(target, this.GetType().Name + level);
            target.Enemy.Effects.Add(corrosion);
        }
    }
Exemplo n.º 2
0
 public void ReClanim(WarEntity entity)
 {
     Debug.Assert(entity.OriginWarFactory == this, "Wrong factory reclacimed!");
     Destroy(entity.gameObject);
 }
Exemplo n.º 3
0
        /// <summary> 出征转移目标 </summary>
        public ASObject CommandStart(TGGSession session, ASObject data)
        {
            if (!data.ContainsKey("id"))
            {
                return(null);
            }
            var id = Convert.ToInt32(data.FirstOrDefault(m => m.Key == "id").Value);  //id:[int] 出征Vo的主键Id

            var entity = new WarEntity();
            var userid = session.Player.User.id;

            session.Player.War.WarBattle = new WarEntity();

            var bq = tg_war_battle_queue.GetEntityByUseridAndId(id, userid); //tg_war_battle_queue.FindByid(id);

            if (bq == null)
            {
                return(CommonHelper.ErrorResult(ResultType.NO_DATA));
            }
            var time = (DateTime.Now.Ticks - 621355968000000000) / 10000;

            if (bq.time > time)
            {
                return(CommonHelper.ErrorResult(ResultType.WAR_NOT_ARRIVE));
            }

            var psList = tg_war_partner.GetEntityByUserId(userid);
            var city   = (new Share.War()).GetWarCity(bq.end_CityId); //目标据点

            if (city == null)                                         //如果目标据点不等于玩家
            {
                var bcity = Variable.BASE_WARCITY.FirstOrDefault(m => m.id == bq.end_CityId);
                if (bcity == null)
                {
                    return(CommonHelper.ErrorResult(ResultType.BASE_TABLE_ERROR));
                }
                entity = bcity.type != (int)WarLandType.SPACE ?
                         GetBuildWarEntity(bq.last_CityId, bq.end_CityId, userid, psList) :
                         GetBuildWarEntity(new tg_war_city()
                {
                    base_id = bq.end_CityId, guard_time = 0
                }, userid, psList);
            }
            else
            {
                if (city.user_id == userid)//终点为自己的据点
                {
                    entity = GetBuildWarEntity(city, userid, psList);
                }
                else
                {
                    //玩家数据
                    entity = !(new Share.War()).IsExistPartner(psList, city.user_id) ?
                             GetBuildWarEntity(bq.last_CityId, bq.end_CityId, userid, psList) :
                             GetBuildWarEntity(city, userid, psList);
                }
            }

            session.Player.War.WarBattle = entity;
            return(BulidData(entity.OperableCityIds, entity.OperableRivalCityIds));
        }