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));
     }
 }
Exemplo n.º 2
0
        public Player(IRoller roller, IIndicesReader reader, IWriter writer)
        {
            this.roller = roller;
            this.reader = reader;
            this.writer = writer;

            amount = Constants.INITIAL_AMOUNT;
        }
Exemplo n.º 3
0
 public void passTime(float timePassed, Character doer, IRoller roller)
 {
     timeLeft -= timePassed;
     if (ready != null)
     {
         ready(this, null);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
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);
     }
 }
Exemplo n.º 7
0
    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());
        }
Exemplo n.º 9
0
    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);
            }
        }
Exemplo n.º 11
0
    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));
            }
        }
Exemplo n.º 13
0
 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);
     }
 }
Exemplo n.º 14
0
        /// <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);
        }
Exemplo n.º 15
0
    }    //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);
    }
Exemplo n.º 16
0
        /// <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);
        }
Exemplo n.º 17
0
        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);
        }
Exemplo n.º 18
0
 public OrdinaryCharacterCreator(IRoller characterRoller) : base(characterRoller)
 {
 }
 public HeroCharacterCreator(IRoller characterRoller) : base(characterRoller)
 {
 }
Exemplo n.º 20
0
 public ChildCharacterCreator(IRoller characterRoller) : base(characterRoller)
 {
 }
Exemplo n.º 21
0
 public override void use(Character doer, List <Character> targets, IRoller roller)
 {
     timeLeft += cooldown;
 }
Exemplo n.º 22
0
 protected BaseCharacterCreator(IRoller characterRoller)
 {
     this._characterRoller = characterRoller;
 }
Exemplo n.º 23
0
 public virtual void use(Character doer, List <Character> targets, IRoller roller)
 {
     Debug.Log("bbbb");
     timeLeft = cooldown;
 }
Exemplo n.º 24
0
 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)]);
 }
Exemplo n.º 26
0
    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);
Exemplo n.º 28
0
 /// <summary>
 /// Returns true if this tag is valid for the given placer.
 /// </summary>
 public virtual bool IsValid(IRoller checkObject)
 {
     return(checkObject.RollingTags.Contains(this));
 }
Exemplo n.º 29
0
 public override bool IsValid(IRoller roller)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 30
0
 public DiceRollerController(IRoller roller)
 {
     this.Roller = roller;
 }