public StartMonsterFight ( |
||
character | ||
monsterGroup | ||
return | bool |
/// <summary> /// /// </summary> /// <param name="entity"></param> /// <param name="path"></param> /// <param name="cellId"></param> public void MovementFinish(AbstractEntity entity, MovementPath path, int cellId) { if (entity.Type == EntityTypeEnum.TYPE_CHARACTER) { var character = (CharacterEntity)entity; if (character.CanGameAction(GameActionTypeEnum.FIGHT)) { foreach (var monsterGroup in m_entityById.Values.OfType <MonsterGroupEntity>()) { if (CanBeAggro(character, cellId, monsterGroup)) { entity.CellId = cellId; if (monsterGroup.AlignmentId == -1) { if (FightManager.StartMonsterFight(character, monsterGroup)) { return; } } else { if (FightManager.StartAggression(monsterGroup, character)) { return; } } } } } } if (entity.CellId == cellId) { return; } entity.Orientation = path.GetDirection(path.LastStep); if (entity.Type == EntityTypeEnum.TYPE_CHARACTER) { var character = (CharacterEntity)entity; var cell = GetCell(cellId); if (cell != null) { if (cell.Trigger != null) { if (!cell.SatisfyConditions(character)) { entity.Dispatch(WorldMessage.IM_ERROR_MESSAGE(InformationEnum.ERROR_CONDITIONS_UNSATISFIED)); return; } entity.CellId = cellId; cell.ApplyActions(character); return; } } } entity.CellId = cellId; }
/// <summary> /// /// </summary> /// <param name="character"></param> /// <param name="grades"></param> public bool StartMonsterFight(CharacterEntity character, IEnumerable <MonsterGradeDAO> grades) { return(FightManager.StartMonsterFight(character, new MonsterGroupEntity(NextMonsterId, Id, RandomFreeCell, grades))); }