internal static Creation FromString(string base64String) { if (string.IsNullOrEmpty(base64String)) { Log.Error("Creation.FromString with empty value!"); return(null); } string[] parts = Conv.StringPartsFromBase64(base64String, "Creation"); Creation creation = new Creation((Creation.CreationType)Conv.getIntFromParts(parts, "a"), God.FromString(Conv.getStringFromParts(parts, "b"))); creation.Count = new CDouble(Conv.getStringFromParts(parts, "d")); creation.Count.Round(); creation.currentDuration = (long)Conv.getIntFromParts(parts, "e"); creation.IsActive = Conv.getStringFromParts(parts, "f").ToLower().Equals("true"); creation.TotalCreated = new CDouble(Conv.getStringFromParts(parts, "g")); creation.CanBuy = Conv.getStringFromParts(parts, "h").ToLower().Equals("true"); creation.NextAtCount = Conv.getIntFromParts(parts, "i"); string text = Conv.getStringFromParts(parts, "j").ToLower(); creation.AutoBuy = (string.IsNullOrEmpty(text) || text.Equals("true")); if (creation.TotalCreated > 0) { creation.CanBuy = true; } return(creation); }
public void StartFight(BattleState.BattleType type) { this.AllEnemies = new List <EnemyData.Enemy>(); switch (type) { case BattleState.BattleType.endless: this.AllEnemies.Add(this.Enemies.Endless); break; case BattleState.BattleType.jacky: this.AllEnemies.Add(this.Enemies.Jacky); break; case BattleState.BattleType.cthulhu: this.AllEnemies.Add(this.Enemies.Cthulhu); break; case BattleState.BattleType.doppel: this.AllEnemies.Add(this.Enemies.Doppelganger); break; case BattleState.BattleType.developer: this.AllEnemies.Add(this.Enemies.Developer); this.AllEnemies.Add(this.Enemies.Creator); break; case BattleState.BattleType.gods: foreach (Creation current in App.State.AllCreations) { if (current.TypeEnum != Creation.CreationType.Shadow_clone) { God godToDefeat = current.GodToDefeat; List <EnemyData.SpecialAttackChance> list = new List <EnemyData.SpecialAttackChance>(); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.doubleDamage, 10)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tripleDamage, 3)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.fiveDamage, 2)); list.Add(new EnemyData.SpecialAttackChance(EnemyData.SpecialAttack.tenDamage, 1)); EnemyData.Enemy item = new EnemyData.Enemy(godToDefeat.Name, string.Empty, godToDefeat.MaxHealth, godToDefeat.Attack, EnemyData.EnemyType.constantDamage, list); this.AllEnemies.Add(item); } } break; } this.currentBattleType = type; this.IsFighting = true; this.IsBattleFinished = false; this.totalFightTime = 0L; this.PlayerHp = App.State.MaxHealth; this.PlayerMaxHP = App.State.MaxHealth; this.CurrentEnemy = this.AllEnemies[0]; this.AllEnemies.RemoveAt(0); this.EnemyDamageText = string.Empty; this.SkillUseText = string.Empty; this.FightingLog = new List <string>(); this.totalFightTimeMilliSeconds = 0L; this.enemyAttackTimer = 0L; this.DefeatedEnemyCount = 0; this.BattleRewardText = string.Empty; this.last3EnemyAttacks = new CDouble[3]; this.currentIntexOfEnemyAttacks = 0; this.GodSpeedModeDuration = 0L; this.GearEyesDuration = 0L; this.DoubleUp = false; this.DamageBlock = false; this.DamageReflect = false; this.HitchanceBonus = 0; this.DodgeChance = 0; this.CounterChance = 0; this.DamageIncreases = new List <DamageChange>(); this.DamageDecreases = new List <DamageChange>(); this.TotalPlayerDamage = 0; }