public Threat NewRemoteThreat() { int id = ++manager.GetGameData().lastThreatId; StaticDb.ThreatType threatType = StaticDb.ThreatType.remote; float deployTime = Random.Range(2f, 6f); StaticDb.ThreatAttacker threatAttacker = (StaticDb.ThreatAttacker)Random.Range(0, 2); StaticDb.ThreatAttack threatAttack; do { threatAttack = (StaticDb.ThreatAttack)manager.GetGameData().threatRandomizer.GetNext(); } while ((int)threatAttack > 5); StaticDb.ThreatDanger threatDanger = (StaticDb.ThreatDanger)Random.Range(0, 3); float moneyLossPerMinute; switch (threatDanger) { case StaticDb.ThreatDanger.low: moneyLossPerMinute = Random.Range(1f, 1.5f); break; case StaticDb.ThreatDanger.medium: moneyLossPerMinute = Random.Range(2f, 2.5f); break; case StaticDb.ThreatDanger.high: moneyLossPerMinute = Random.Range(3f, 3.5f); break; case StaticDb.ThreatDanger.fakeLocal: moneyLossPerMinute = Random.Range(3f, 3.5f); break; case StaticDb.ThreatDanger.timeEvent: moneyLossPerMinute = 0; break; default: moneyLossPerMinute = 0; break; } Threat threat = new Threat(id, threatType, deployTime, threatAttacker, threatDanger, threatAttack, moneyLossPerMinute, false); //Debug.Log(threat); return(threat); }
public Threat(int id, StaticDb.ThreatType threatType, float deployTime, StaticDb.ThreatAttacker threatAttacker, StaticDb.ThreatDanger threatDanger, StaticDb.ThreatAttack threatAttack, float moneyLossPerMinute, bool fromCreateRemote) { this.id = id; this.threatType = threatType; this.deployTime = deployTime; this.threatAttacker = threatAttacker; this.threatDanger = threatDanger; this.threatAttack = threatAttack; this.moneyLossPerMinute = moneyLossPerMinute; this.fromCreateRemote = fromCreateRemote; }
public Threat NewFakeLocalThreat() { int id = ++manager.GetGameData().lastThreatId; StaticDb.ThreatType threatType = StaticDb.ThreatType.fakeLocal; float deployTime = Random.Range(2f, 6f); StaticDb.ThreatAttacker threatAttacker = StaticDb.ThreatAttacker.intern; StaticDb.ThreatAttack threatAttack = StaticDb.ThreatAttack.fakeLocal; StaticDb.ThreatDanger threatDanger = StaticDb.ThreatDanger.fakeLocal; float moneyLossPerMinute = Random.Range(3f, 3.5f); Threat threat = new Threat(id, threatType, deployTime, threatAttacker, threatDanger, threatAttack, moneyLossPerMinute, false); //Debug.Log(threat); return(threat); }