Exemple #1
0
    public void OnFireDamage(FireDamageArgs args)
    {
        FreezeStatus freeze = GetComponent <FreezeStatus>();

        if (freeze != null)
        {
            freeze.duration = 0f;
            return;
        }

        BurnStatus burn = GetComponent <BurnStatus>();

        if (burn != null)
        {
            if (args.duration > burn.duration)
            {
                burn.duration        = args.duration;
                burn.damagePerSecond = args.dps;
            }
        }
        else
        {
            burn                 = gameObject.AddComponent <BurnStatus>();
            burn.duration        = args.duration;
            burn.damagePerSecond = args.dps;
        }
    }
Exemple #2
0
 private void ReportProgress(BurnStatus aBurnStatus, int aTrack, int aPercentage)
 {
     if (DeviceProgressUpdate != null)
     {
         DeviceProgressUpdate(aBurnStatus, aTrack, aPercentage);
     }
 }
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aTrack, int aPercentage)
 {
     CurrentStatus = aBurnStatus;
     if (BurnProgressUpdate != null)
     {
         BurnProgressUpdate(aBurnStatus, aTrack, aPercentage);
     }
 }
Exemple #4
0
    private void BurnEnemy(Enemy e)
    {
        GameObject burnObj = Instantiate(StatusEffectContainer.instance.GetStatus("Burn"));
        BurnStatus burn    = burnObj.GetComponent <BurnStatus>();

        burn.damage     = Mathf.CeilToInt(mage.damage * BURN_DAMAGE_MULTIPLIER);
        burn.duration   = BURN_DURATION;
        burn.numSpreads = NUM_BURN_SPREADS;
        e.AddStatus(burnObj);
    }
    private void BurnEnemy(IDamageable damageable, int damage)
    {
        // Add burn status
        GameObject burnObj = Instantiate(StatusEffectContainer.instance.GetStatus("Burn"));
        BurnStatus burn    = burnObj.GetComponent <BurnStatus>();

        burn.damage     = Mathf.CeilToInt(damage * BURN_DAMAGE_MULTIPLIER);
        burn.duration   = BURN_DURATION;
        burn.numSpreads = NUM_BURN_SPREADS;
        ((Enemy)damageable).AddStatus(burnObj);
        lastShotFireball.OnDamagedTarget -= BurnEnemy;
    }
Exemple #6
0
 /// <summary> Set the burn status of a specific metal </summary>
 /// <param id="metal"> The name of the metal power to change the burn </param>
 public void SetBurnStatus(string metal, int status)
 {
     if (status < 0)
     {
         status = 0;
     }
     if (status > 5)
     {
         status = 5;
     }
     BurnStatus.SetInt(metal, status);
     Entity.WatchedAttributes.MarkPathDirty("allomancy");
 }
        public void Test()
        {
            var speciesBuilder = new SpeciesBuilder(1, "Test Species");

            speciesBuilder.SetAllStats(10);
            speciesBuilder.Weight = 10;
            speciesBuilder.Height = 10;

            var type = new Type(
                "Test Type",
                "Test type description",
                new Dictionary <IType, decimal>(),
                new Dictionary <IType, decimal>());

            speciesBuilder.Types = new IndexedSet <IType> {
                type
            };

            var category = new MoveCategory("Test Category", PermanentStatType.Attack, PermanentStatType.Defense);
            var move     = new Move("Test Move", category, 10, 100, 1, 10, "Test Move Description", type);

            speciesBuilder.Moves = new IndexedSet <IMove> {
                move
            };
            speciesBuilder.Tier = new Tier("Test Tier", "Test Tier Description");

            var species = speciesBuilder.Build();
            var pokedex = new Pokedex(new HashSet <ISpecies> {
                species
            });
            var formats = new FormatRegistry(new UniqueDictionary <string, IFormat>
            {
                ["TestFormat"] = new Format("TestFormat", "Test Format")
            });
            var generation     = new Generation("Test Generation", "TG", pokedex, formats);
            var pokemonBuilder = new BattlePokemonBuilder(generation.StatFormula, "Test Pokemon", 10);

            var pokemon  = pokemonBuilder.WithSpecies(species).Build(species);
            var pokemons = new IndexedSet <IBattlePokemon> {
                pokemon
            };
            var trainers = new IndexedSet <ITrainer>
            {
                new Trainer("Test Trainer", pokemons)
            };
            var battle       = new Battle(generation, trainers);
            var burn         = new BurnStatus(pokemon, battle.EventBus);
            var normalAttack = battle.StatFormula.CalculateStat(pokemon.Attack);

            Assert.That(pokemon.Attack.ModifiedValue, Is.EqualTo(normalAttack / 2));
        }
        private void burnManager_BurnProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
        {
            if (lbBurningStatus.InvokeRequired)
            {
                ThreadSafeBurnAudioDelegate d = burnManager_BurnProgressUpdate;
                lbBurningStatus.Invoke(d, new object[] { eBurnStatus, eTrack, ePercentage });
                return;
            }

            // Sometimes we don't get correct percentages, so set the previous entry to 100%
            if (eTrack > 1)
            {
                dataGridViewBurn.Rows[eTrack - 2].Cells[0].Value = 100;
            }

            if (eTrack > -1)
            {
                dataGridViewBurn.Rows[eTrack - 1].Cells[0].Value = ePercentage <= 100 ? ePercentage : 100;
            }
            else
            {
                switch (eBurnStatus)
                {
                case BurnStatus.Checking:
                    lbBurningStatus.Text = localisation.ToString("Burning", "Checking");
                    break;

                case BurnStatus.Blanking:
                    lbBurningStatus.Text = localisation.ToString("Burning", "Erasing");
                    break;

                case BurnStatus.LeadIn:
                    lbBurningStatus.Text = localisation.ToString("Burning", "Leaadin");
                    break;

                case BurnStatus.LeadOut:
                    dataGridViewBurn.Rows[dataGridViewBurn.Rows.Count - 1].Cells[0].Value = 100;
                    lbBurningStatus.Text = localisation.ToString("Burning", "Leadout");
                    break;

                case BurnStatus.Burning:
                    lbBurningStatus.Text = localisation.ToString("Burning", "Burning");
                    break;

                case BurnStatus.Finished:
                    lbBurningStatus.Text = localisation.ToString("Burning", "Finished");
                    break;
                }
            }
        }
Exemple #9
0
    public void burn()
    {
        if (burnStatus != BurnStatus.NOBURN)
        {
            fireResistance            -= 10;
            fireResistanceRecoveryTime = initFireResistanceRecoveryTime;

            burnStatus = BurnStatus.NOBURN;
            noBurnTime = initNoBurnTime;

            uiManager.showFireResistanceUI(true);
            uiManager.burnEffect();
            spriteObject.GetComponent <SpriteRenderer>().sprite = burnSprites[(int)nowConstructWallType];
        }
    }
Exemple #10
0
    public void OnIceDamage(IceDamageArgs args)
    {
        BurnStatus burn = GetComponent <BurnStatus>();

        if (burn != null)
        {
            burn.duration = 0f;
            return;
        }

        FreezeStatus freeze = GetComponent <FreezeStatus>();

        if (freeze != null)
        {
            freeze.duration = Mathf.Max(freeze.duration, args.duration);
            return;
        }
        else
        {
            freeze          = gameObject.AddComponent <FreezeStatus>();
            freeze.duration = args.duration;
        }
    }
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aPercentage)
 {
     ReportProgress(aBurnStatus, -1, aPercentage);
 }
 private void burnManager_BurnProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
 {
     log.Info("BurnEvent: Status: {0} ({1})", eBurnStatus.ToString(), Convert.ToString(ePercentage));
 }
Exemple #13
0
 public BurnResult(BurnStatus status, IResponseData response)
     : this(status, response, new Dictionary <Key, IResponseData>())
 {
 }
Exemple #14
0
 /// <summary> Get the burn status of a specific metal </summary>
 /// <param id="metal"> The name of the metal power to get the burn of </param>
 public int GetBurnStatus(string metal)
 {
     return(BurnStatus.GetInt(metal));
 }
Exemple #15
0
 public BurnResult(BurnStatus status, IResponseData response, IDictionary <Key, IResponseData> responseSections)
 {
     Status           = status;
     Response         = response;
     ResponseSections = responseSections ?? throw new ArgumentNullException(nameof(responseSections));
 }
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aTrack, int aPercentage)
 {
     CurrentStatus = aBurnStatus;
       if (BurnProgressUpdate != null)
     BurnProgressUpdate(aBurnStatus, aTrack, aPercentage);
 }
Exemple #17
0
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aPercentage)
 {
     ReportProgress(aBurnStatus, -1, aPercentage);
 }
        private void burnManager_BurnProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
        {
            if (lbBurningStatus.InvokeRequired)
              {
            ThreadSafeBurnAudioDelegate d = burnManager_BurnProgressUpdate;
            lbBurningStatus.Invoke(d, new object[] {eBurnStatus, eTrack, ePercentage});
            return;
              }

              // Sometimes we don't get correct percentages, so set the previous entry to 100%
              if (eTrack > 1)
            dataGridViewBurn.Rows[eTrack - 2].Cells[0].Value = 100;

              if (eTrack > -1)
            dataGridViewBurn.Rows[eTrack - 1].Cells[0].Value = ePercentage <= 100 ? ePercentage : 100;
              else
              {
            switch (eBurnStatus)
            {
              case BurnStatus.Checking:
            lbBurningStatus.Text = localisation.ToString("Burning", "Checking");
            break;

              case BurnStatus.Blanking:
            lbBurningStatus.Text = localisation.ToString("Burning", "Erasing");
            break;

              case BurnStatus.LeadIn:
            lbBurningStatus.Text = localisation.ToString("Burning", "Leaadin");
            break;

              case BurnStatus.LeadOut:
            dataGridViewBurn.Rows[dataGridViewBurn.Rows.Count - 1].Cells[0].Value = 100;
            lbBurningStatus.Text = localisation.ToString("Burning", "Leadout");
            break;

              case BurnStatus.Burning:
            lbBurningStatus.Text = localisation.ToString("Burning", "Burning");
            break;

              case BurnStatus.Finished:
            lbBurningStatus.Text = localisation.ToString("Burning", "Finished");
            break;
            }
              }
        }
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aPercentage)
 {
     CurrentStatus = aBurnStatus;
     ReportProgress(aBurnStatus, -1, aPercentage);
 }
 private void burnManager_BurnProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
 {
     log.Info("BurnEvent: Status: {0} ({1})", eBurnStatus.ToString(), Convert.ToString(ePercentage));
 }
Exemple #21
0
    void Update()
    {
        if (isDead)
        {
            return;
        }

        deltaTime += Time.deltaTime;

        if (deltaTime > 0.2f)
        {
            deltaTime -= 0.2f;

            if (burnStatus == BurnStatus.NOBURN)
            {
                noBurnTime -= 0.2f;
                if (noBurnTime <= 0)
                {
                    burnStatus = BurnStatus.BURNING;
                    fireResistanceRecoveryTime = initFireResistanceRecoveryTime;
                }
            }
            else if (burnStatus == BurnStatus.BURNING)
            {
                fireResistanceRecoveryTime -= 0.2f;
                if (fireResistanceRecoveryTime <= 0)
                {
                    burnStatus = BurnStatus.RECOVERY;
                    spriteObject.GetComponent <SpriteRenderer>().sprite = sprites[(int)nowConstructWallType];
                }
            }
            else if (burnStatus == BurnStatus.RECOVERY)
            {
                if (fireResistance < 100)
                {
                    fireResistance += 1;
                }
                else if (fireResistance == 100)
                {
                    burnStatus = BurnStatus.IDLE;
                    uiManager.showFireResistanceUI(false);
                }
            }
        }

        if (nowLookTile != null && (nowLookTile.WallState == WallType.STRAW || nowLookTile.WallState == WallType.WOOD))
        {
            UIManager.Instance.showFireText(true);
        }
        else
        {
            UIManager.Instance.showFireText(false);
        }

        if (isActing)
        {
            leftActTime -= Time.deltaTime;
            if (leftActTime < 0)
            {
                if (nowAct == Act.CONSTRUTION)
                {
                    constructionWall(nowConstructWallType);
                }
                else if (nowAct == Act.FIRE)
                {
                    fireWall();
                }
                cancelActing();
            }
        }

        if (fireResistance <= 0)
        {
            gameManager.Wolves[0].soundEnd();
            dead();
        }
    }
 private void ReportProgress(BurnStatus aBurnStatus, int aTrack, int aPercentage)
 {
     if (DeviceProgressUpdate != null)
     DeviceProgressUpdate(aBurnStatus, aTrack, aPercentage);
 }
 // We need this because the BurnManager implements the interface event but does not do device output parsing
 private void DeviceHelper_ProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
 {
     ReportProgress(eBurnStatus, eTrack, ePercentage);
 }
 // We need this because the BurnManager implements the interface event but does not do device output parsing
 private void DeviceHelper_ProgressUpdate(BurnStatus eBurnStatus, int eTrack, int ePercentage)
 {
     ReportProgress(eBurnStatus, eTrack, ePercentage);
 }
 // Have a common function so we do not need to check for registered events everywhere
 private void ReportProgress(BurnStatus aBurnStatus, int aPercentage)
 {
     CurrentStatus = aBurnStatus;
       ReportProgress(aBurnStatus, -1, aPercentage);
 }