Ejemplo n.º 1
0
        public override int ApplyEffect(EffectCast CastInfos)
        {
            // Possibilité de spawn une creature sur la case ?
            if (CastInfos.Caster.Fight.IsCellWalkable(CastInfos.CellId))
            {
                var InvocationId    = CastInfos.Value1;
                var InvocationLevel = CastInfos.Value2;
                var Monster         = MonsterTable.GetMonster(InvocationId);

                // Template de monstre existante
                if (Monster != null)
                {
                    Monster.Initialize();
                    var MonsterLevel = Monster.GetLevelOrNear(InvocationLevel);

                    // Level de monstre existant
                    if (MonsterLevel != null)
                    {
                        var MonsteFighter = new StaticMonster(CastInfos.Caster.Fight, MonsterLevel, CastInfos.Caster.Fight.NextActorInvocationId(CastInfos.Caster), Invocator: CastInfos.Caster);
                        MonsteFighter.JoinFight();
                        MonsteFighter.Fight.JoinFightTeam(MonsteFighter, CastInfos.Caster.Team, false, CastInfos.CellId);
                        MonsteFighter.Fight.RemakeTurns();
                        MonsteFighter.Fight.SendToFight(new GameInformationCoordinateMessage(MonsteFighter.Fight.Fighters));
                        MonsteFighter.Fight.SendToFight(new GameTurnListMessage(MonsteFighter.Fight.getWorkerFighters()));
                        MonsteFighter.Fight.GetCell(CastInfos.CellId).GetObjects <FightGroundLayer>().ForEach(x => x.onWalkOnLayer(MonsteFighter, MonsteFighter.Fight.GetCell(CastInfos.CellId)));
                    }
                }
            }

            return(-1);
        }
//	private  Dictionary<int, int> dict = new  Dictionary<int, int>();
	public static StaticMonster Instance()
	{
        if(_instance == null)
        {
            lock(lockHelper)
            {
                if(_instance == null)
				{
                     _instance = new StaticMonster();
//					#if UNITY_EDITOR
					_instance.readData();
//					#endif
				}
            }
        }
        return _instance;
    }