//private static bool startup = false; public GameController() { Debug.Log("GameController."); CurrentGameMode = GameMode.NORMAL; GameControlProxy.add(this); WindowConfigure.initAll(); if (Rnd == null) Rnd = new RndGenerator((int)System.DateTime.Now.Ticks); if (GameActionEvent == null) GameActionEvent = new GameActionEvent(); if (PlayingLogger == null) PlayingLogger = new PlayLogger(); if (DungeonInformation == null) DungeonInformation = new DungeonInformation(); if (ObjectList == null) ObjectList = new ObjectList(); if (DgParameterTable == null) DgParameterTable = new DungeonParameterTable(5); if (SoundController == null) SoundController = SoundController.Instance; if (TempGameState == null) TempGameState = new Stack<GameState>(); if (ActCommandController == null) ActCommandController = new ActionCommandController(); if (GlobalGameInformation == null) GlobalGameInformation = new GlobalGameInformation(); if (SystemConfigure == null) SystemConfigure = new SystemConfigure(); if (SystemConfigureMenu == null) SystemConfigureMenu = new GameSystemConfigureMenu(); DataSaveSystem.addGameActionEvent(); //var t = new TagList(); SaveDataConverter.add(this); //PlayerUIController.setVisible(false); gameStateChange(GameState.PRELOAD); filedModeChange(FieldMode.TOWN); }
public MiniMap(DungeonInformation info, TileEntity[] tiles) { Info = info; Tiles = tiles; var size = info.CurrentFloor.FloorRect.size; TileDetectionTable = new bool[(int)size.x,(int)size.y]; }
private string CreateNews(T_RLU_NewsHistory model) { string result; DungeonInformation duninfo = TableDungeonMaster.GetValue(model.iDungeonObjNo); switch (model.iActionNo) { //ダンジョン挑戦 case NewsType.DungeonStart: result = string.Format("news:<color={0}>{1}</color>が<color={2}>{3}</color>に挑戦開始", CommonConst.Color.Player, model.vcCharacterName, CommonConst.Color.Dungeon, duninfo.Name); break; //ダンジョン進行 case NewsType.DungeonNext: result = string.Format("news:<color={0}>{1}</color>が<color={2}>{3}</color>{4}Fに到達", CommonConst.Color.Player, model.vcCharacterName, CommonConst.Color.Dungeon, duninfo.Name, model.iFloor); break; //踏破失敗 case NewsType.DisruptFail: result = string.Format("news:<color={0}>{1}</color>が<color={5}>{6}</color>にて<color={2}>{3}</color>{4}Fで踏破失敗", CommonConst.Color.Player, model.vcCharacterName, CommonConst.Color.Dungeon, duninfo.Name, model.iFloor, CommonConst.Color.DeathCause, model.vcCouse); break; //踏破成功 case NewsType.DisruptSuccess: result = string.Format("news:<color={0}>{1}</color>が<color={2}>{3}</color>の踏破成功", CommonConst.Color.Player, model.vcCharacterName, CommonConst.Color.Dungeon, duninfo.Name, model.iFloor); break; default: result = ""; break; } return(result); }
public PlayerScore(PlayerParameter param, DungeonInformation dginfo, CauseOfDeathBasis cod) { PlayerParameter = param; DgInfo = dginfo; TotalScore = calcScore(); EquipingNames = getEquiping(); TotalTurn = dginfo.CurrentTotalTurnCount; COD = cod; }
public static DungeonInformation GetValue(long objno) { TableDungeonMasterData data = Array.Find(Table, i => i.DungeonObjNo == objno); DungeonInformation dun = new DungeonInformation(); AttachValue(dun, data); return(dun); }
public void setDungeonData(DungeonInformation dginfo, DungeonParameterTable dgparamtable) { LocalDgData = new LocalDungeonData(dginfo, dgparamtable); var clist = LocalDgData.DgInfo.Enemys.ToList(); clist.Add(Player.EntityData); foreach (var enemy in clist) { enemy.setAttackerLog(clist); } }
public async Task WalkOnFloor() { Hero hero = await this.heroService.GetHero(); this.CheckIfHeroIsInDungeon(hero); DungeonInformation dungeonInformation = await this.GetDungeonInformation(); this.CheckIfThereAreMonstersOnFloor(dungeonInformation.MonstersDefeatedOnCurrentFloor); await this.chronometerService.SetWorkUntil(WalkingDurationInSeconds, WorkStatus.Dungeon); }
//public static void SetValue(ManageDungeon dun) //{ // TableDungeonMasterData data = Array.Find(Table, i => i.DungeonObjNo == dun.DungeonObjNo); // dun.X = data.X; // dun.Y = data.Y; // dun.DungeonName = data.Name; // dun.CommonProb = data.Prob; // dun.DisruptFloor = data.DisruptFloor; // dun.IsTimer = data.IsTimer; // dun.IsAnalyze = data.IsAnalyze; // dun.IsBringing = data.IsBringing; // dun.ItemS = data.ItemS; // dun.ItemP = data.ItemP; // dun.ItemC = data.ItemC; // dun.ItemM = data.ItemM; // dun.EnemyS = data.EnemyS; // dun.EnemyP = data.EnemyP; // dun.EnemyC = data.EnemyC; // dun.EnemyM = data.EnemyM; // dun.TrapS = data.TrapS; // dun.TrapP = data.TrapP; // dun.TrapC = data.TrapC; // dun.TrapM = data.TrapM; //} public static Dictionary <long, DungeonInformation> GetAllValue() { Dictionary <long, DungeonInformation> result = new Dictionary <long, DungeonInformation>(); foreach (TableDungeonMasterData data in Table) { DungeonInformation dun = new DungeonInformation(); AttachValue(dun, data); result.Add(data.DungeonObjNo, dun); } return(result); }
public async Task GoToNextFloor() { Hero hero = await this.heroService.GetHero(); this.CheckIfHeroIsInDungeon(hero); await this.chronometerService.SetWorkUntil(WalkingDurationInSeconds, WorkStatus.Dungeon); DungeonInformation dungeonInformation = await this.GetDungeonInformation(); dungeonInformation.CurrentFloor++; dungeonInformation.MonstersDefeatedOnCurrentFloor = 0; await this.context.SaveChangesAsync(); }
public static void makeTrapsInRoom(Room room, DungeonInformation dginfo,bool isdeteced) { var tposs = dginfo.getAllTrapsInRoom(room).ConvertAll(t => t.Position); var itemposs = dginfo.getAllItemsInRoom(room).ConvertAll(i => i.Position); var denyposs = new List<Vector2>(tposs); denyposs.AddRange(itemposs); denyposs.Add(dginfo.StairsPosition); int count = Mathf.Min((int)(room.SquareMeasure / 3), dginfo.RemainingTrapCapacity); var traps = dginfo.CurrentDungeonParameter.DistributionTable.randomSelectTrapFromCurrentFloor(dginfo.CurrentFloorNumber, count); for (int i = 0; i < count; i++) { var emptypos = room.selectRandomPosition(denyposs); ObjectEntityFactory.enableTrapEntity(traps[i], emptypos,isdeteced); denyposs.Add(emptypos); } }
private static void AttachValue(DungeonInformation dun, TableDungeonMasterData data) { dun.DungeonObjNo = data.DungeonObjNo; dun.X = data.X; dun.Y = data.Y; dun.MType = data.MType; dun.CameraName = data.CameraName; dun.BaseLoadState = data.BaseLoadState; dun.Prob = data.Prob; dun.DisruptFloor = data.DisruptFloor; dun.IsTimer = data.IsTimer; dun.IsAnalyze = data.IsAnalyze; dun.IsBringing = data.IsBringing; dun.IsBadVisible = data.IsBadVisible; dun.KilnProb = data.Kilnprob; dun.StartProbHp = data.StartProbHp; dun.StartProbAtk = data.StartProbAtk; dun.StartProbExp = data.StartProbExp; dun.ItemS = data.ItemS; dun.ItemP = data.ItemP; dun.ItemC = data.ItemC; dun.ItemM = data.ItemM; dun.EnemyS = data.EnemyS; dun.EnemyP = data.EnemyP; dun.EnemyC = data.EnemyC; dun.EnemyM = data.EnemyM; dun.TrapS = data.TrapS; dun.TrapP = data.TrapP; dun.TrapC = data.TrapC; dun.TrapM = data.TrapM; dun.EnemyHpProb = data.EnemyHpProb; dun.EnemyAtkProb = data.EnemyAtkProb; dun.EnemyExpProb = data.EnemyExpProb; dun.BossObjNo = data.BossObjNo; if (GameStateInformation.IsEnglish == false) { dun.Name = data.Name; dun.Description = data.Description; } else { dun.Name = data.NameEn; dun.Description = data.DescriptionEn; } }
public async Task StartDungeon() { Hero hero = await this.heroService.GetHero(); this.CheckIfHeroCanStartDungeon(hero); this.CheckIfHeroAlreadyInDungeon(hero); await this.resourcePouchService.DecreaseResource(ResourceNames.DungeonKeys, 1); await this.chronometerService.SetWorkUntil(WalkingDurationInSeconds, WorkStatus.Dungeon); DungeonInformation dungeonInformation = await this.GetDungeonInformation(); dungeonInformation.CurrentFloor = 1; dungeonInformation.MonstersDefeatedOnCurrentFloor = 0; await this.context.SaveChangesAsync(); }
public async Task AttackMonster() { DungeonInformation dungeonInformation = await this.GetDungeonInformation(); int fightId = await this.fightService.InitiateMonsterFight(dungeonInformation.CurrentFloor); Fight fight = await this.context.Fights.FindAsync(fightId); Hero hero = await this.heroService.GetHero(); if (fight.WinnerName != hero.Name) { await this.EndDungeon(false); } else { hero.WorkStatus = WorkStatus.DungeonIdle; dungeonInformation.MonstersDefeatedOnCurrentFloor++; await this.context.SaveChangesAsync(); } }
private void Dummy(PlayerController player, DungeonInformation dginfo, string escapesrcname) { }
public void dungeonRitire(PlayerController player, DungeonInformation dginfo) { var score = new PlayerScore(player.Parameter, dginfo, new DungeonRetire(player)); DungeonRitire(player, dginfo); GameController.loadDungeonResult(score); player.Parameter.reset(true); }
void robberChallenge(DungeonInformation dginfo) { RobberChallengeCount++; }
public void playerisDead(PlayerController player, DungeonInformation dginfo, CauseOfDeathBasis cod) { var score = new PlayerScore(player.Parameter, dginfo, cod); PlayerIsDead(cod); GameController.loadDungeonResult(score); player.Parameter.reset(true); }
private static bool saveFile(uint filenumber,PlayerController player,DungeonInformation dginfo, DungeonParameterTable dgpramtable) { if (filenumber >= filename.Length) throw new ArgumentOutOfRangeException(); string savepath = savedir + @"\" + filename[filenumber]; LocalSaveData lcs = new LocalSaveData(); lcs.setPlayerData(player); lcs.setDungeonData(dginfo,dgpramtable); lcs.setGlobalGameInformation(GameController.GlobalGameInformation); string json = JsonUtility.ToJson(lcs,true); Debug.Log(json); using (FileStream fs = new FileStream(savepath, FileMode.Create, FileAccess.Write)){ BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(fs, json); return true; } return false; }
public void SetDungeon(DungeonInformation dun, ushort floor) { this.don = (ushort)dun.DungeonObjNo; this.f = floor; }
public void shopEmergency(DungeonInformation dginfo) { dginfo.CurrentShopMode = DungeonInformation.ShopMode.EMERGENCY; dginfo.Items.ForEach(item => item.Object.payment(false)); ShopEmergency(dginfo); }
public void dungeonEscape(PlayerController player, DungeonInformation dginfo, string escapesrcname) { var score = new PlayerScore(player.Parameter, dginfo, new DungeonEscape(player, escapesrcname)); ItemInventory.removeAllCommodities(player.Parameter.Inventory); DungeonEscape(player, dginfo, escapesrcname); GameController.loadDungeonResult(score); player.Parameter.reset(false); }
void dungeonClear(PlayerController player,DungeonInformation dginfo) { addDungeonClearCount((int)dginfo.CurrentDungeonParameter.Rank); }
public void infoUpdate(DungeonInformation dginfo) { setFloorNum(dginfo.CurrentFloorNumber); }
private void Dummy(PlayerController player, DungeonInformation dginfo) { }
public void unloadDungeon(DungeonInformation dginfo) { UnloadDungeon(dginfo); }
void unloadDungeon(DungeonInformation dginfo) { Debug.Log("start"); //GameController.gameStateChange(GameController.GameState.PROGRESS); MenuContoller.doDisableAllMenu(); this.disableAllObjectsOnMap(); //this.disableAllTiles(); StartCoroutine(this.disableAllTiles()); Debug.Log("end"); //GameController.gameStateChange(GameController.GameState.PLAY); }
private void Dummy(DungeonInformation dginfo) { }
public void init(PlayerParameter param, DungeonInformation dginfo) { paramUpdate(param); infoUpdate(dginfo); }
public void renewMiniMap(DungeonInformation dginfo, TileEntity[] tiles) { CurrentMiniMap = new MiniMap(dginfo, tiles); }