public override IEnumerable <uint> GenerateScores(IRoller roller) { for (uint i = 0; i < ScoresCount; ++i) { yield return((uint)roller.RollMany(DieEnum.D6, 4).OrderBy(score => score).Skip(1).Sum(score => score)); } }
public Player(IRoller roller, IIndicesReader reader, IWriter writer) { this.roller = roller; this.reader = reader; this.writer = writer; amount = Constants.INITIAL_AMOUNT; }
public void passTime(float timePassed, Character doer, IRoller roller) { timeLeft -= timePassed; if (ready != null) { ready(this, null); } }
public override void use(Character doer, List <Character> targets, IRoller roller) { Debug.Log("bla"); base.use(doer, targets, roller); for (int i = 0; i < targets.Count; i++) { targets[i].dealDamage(10); } }
public Game(List <IDadosPropriedade> propriedades, List <Player> players, IRoller roller, DateTime dataCriação) : base(Guid.NewGuid(), dataCriação) { Iniciado = false; Roller = roller; Players = players; Rodada = 1; _gameState = new GameState(propriedades, players, GameConfig.VALOR_INICIAL); _playerAtual = 0; }
public new void passTime(float timePassed, Character doer, IRoller roller) { timeLeft -= timePassed; while (timeLeft <= 0) { use(doer, new List <Character> { doer.target }, roller); Debug.Log("in while" + timeLeft); } }
public new void use(Character doer, List <Character> targets, IRoller roller) { base.use(doer, targets, roller); float myRoll = roller.roll(); float baseDamage = doer.weapon.damgeMin + (doer.weapon.damgeMax - doer.weapon.damgeMin) * myRoll; baseDamage += doer.attack.value; baseDamage = mods.calc(baseDamage); targets[0].dealDamage(baseDamage - targets[0].defense.value); }
public uint GetD6ActionPointsRoll(Character character, IRoller roller) { uint rollsNumber = this.GetD6RollsAvailbleForActionPointRoll(character); if (rollsNumber == 1) { return(roller.Roll(DieEnum.D6)); } return(roller.RollMany(DieEnum.D6, rollsNumber).Max()); }
public new void use(Character doer, List <Character> targets, IRoller roller) { base.use(doer, targets, roller); float myRoll = roller.roll(); float baseHeal = doer.weapon.damgeMin + (doer.weapon.damgeMax - doer.weapon.damgeMin) * myRoll; baseHeal += doer.attack.value; baseHeal = mods.calc(baseHeal); targets[0].heal(baseHeal); }
public virtual string GetRandomName(Gender gender, IRoller roller) { switch (gender) { case Gender.Male: return(this._maleNames.Value[roller.CoreGenerator.NextInt(0, this._maleNames.Value.Count - 1)]); case Gender.Female: return(this._femaleNames.Value[roller.CoreGenerator.NextInt(0, this._femaleNames.Value.Count - 1)]); default: throw new ArgumentOutOfRangeException(nameof(gender), gender, null); } }
public new void use(Character doer, List <Character> targets, IRoller roller) { base.use(doer, targets, roller); float myRoll = roller.roll(); float baseHeal = doer.weapon.damgeMin + (doer.weapon.damgeMax - doer.weapon.damgeMin) * myRoll; baseHeal += doer.attack.value; baseHeal = mods.calc(baseHeal); for (int i = 0; i < targets.Count; i++) { targets[i].heal(baseHeal / 2);//2 will be something else } }
public override IEnumerable <uint> GenerateScores(IRoller roller) { uint[] numberOfDicesPerScore = new uint[ScoresCount]; numberOfDicesPerScore.Fill(3u); for (uint i = this._poolSize - (3 * ScoresCount); i <= this._poolSize; ++i) { numberOfDicesPerScore[roller.CoreGenerator.NextInt(0, (int)ScoresCount - 1)] += 1; } for (uint i = 0; i < ScoresCount; ++i) { yield return((uint)roller.RollMany(DieEnum.D6, numberOfDicesPerScore[i]).OrderByDescending(score => score).Take(3).Sum(score => score)); } }
public void reduseCooldown(float timePassed, IRoller roller) { if (abilities != null) { for (int i = 0; i < abilities.Count; i++) { abilities[i].passTime(timePassed, this, roller); } } if (attackAbility != null) { Debug.Log(attackAbility); attackAbility.passTime(timePassed, this, roller); } }
/// <summary> /// Returns true if the roller has at least all the tags this entry has /// </summary> /// <returns></returns> public virtual bool AllTagsTrue(IRoller roller) { for (int i = 0; i < tags.Count; i++) { if (tags[i] == null) { return(false); } if (!tags[i].IsValid(roller)) { return(false); } } return(true); }
} //refactor later. public Character create(Job type, float currentHp, IRoller roller) { Stat attack = new Stat(rollStat(roller, type.minAttack, type.maxAttack)); Stat deffnse = new Stat(rollStat(roller, type.minDefense, type.maxDefense)); Stat speed = new Stat(3); Stat charisma = new Stat(rollStat(roller, type.minCharisma, type.maxCharisma)); Stat Hp = new Stat(rollStat(roller, type.minHP, type.maxHP)); Weapon startingWeapon = type.startingWeapon; Armor startingArmor = type.startingArmor; Special[] StartingSpecials = type.startingSpecials; Character c = new PlayerCharacter(attack, deffnse, speed, charisma, Hp, currentHp, startingWeapon, startingArmor, StartingSpecials, 1, null, null); return(c); }
/// <summary> /// Returns true if this entry has at least all the tags the roller has /// </summary> public virtual bool MatchRollerTags(IRoller roller) { for (int i = 0; i < roller.RollingTags.Count; i++) { if (roller.RollingTags[i] == null) { continue; } if (!tags.Contains(roller.RollingTags[i])) { return(false); } } //Debug.Log("Matched tags!",this); return(true); }
public override bool IsValid(IRoller roller) { ITransformRoller tRoller = roller as ITransformRoller; if (tRoller != null && tRoller.Roller() != null) { float depth = tRoller.Roller().position.y; if (depth > shallowest) { return(false); } if (depth < deepest) { return(false); } } return(true); }
public OrdinaryCharacterCreator(IRoller characterRoller) : base(characterRoller) { }
public HeroCharacterCreator(IRoller characterRoller) : base(characterRoller) { }
public ChildCharacterCreator(IRoller characterRoller) : base(characterRoller) { }
public override void use(Character doer, List <Character> targets, IRoller roller) { timeLeft += cooldown; }
protected BaseCharacterCreator(IRoller characterRoller) { this._characterRoller = characterRoller; }
public virtual void use(Character doer, List <Character> targets, IRoller roller) { Debug.Log("bbbb"); timeLeft = cooldown; }
public override bool IsValid(IRoller roller) { return(roller.RollingTags.Contains(this)); }
public virtual string GetRandomSurname(Gender gender, IRoller roller) { // both female & male surnames are written same way - no sex-declination return(this._surnames.Value[roller.CoreGenerator.NextInt(0, this._surnames.Value.Count - 1)]); }
private int rollStat(IRoller roller, int min, int max) { float rolled = roller.roll(); return((int)(min + (max - min) * rolled)); }
public abstract IEnumerable <uint> GenerateScores(IRoller roller);
/// <summary> /// Returns true if this tag is valid for the given placer. /// </summary> public virtual bool IsValid(IRoller checkObject) { return(checkObject.RollingTags.Contains(this)); }
public override bool IsValid(IRoller roller) { throw new NotImplementedException(); }
public DiceRollerController(IRoller roller) { this.Roller = roller; }