Esempio n. 1
0
    private void drop()
    {
        float resMult = MetaScript.getGlobal_Stats().getGatherMultiplier();

        curRes = (int)((float)curRes * resMult);
        MetaScript.getRes().addResource(this.findingType, curRes);
        curRes = 0;
    }
Esempio n. 2
0
    void combat()
    {
        Debug.Log("Combat Entered");

        if (target != null)
        {
            animator.SetBool("attack", true);
            float damage = gameObject.GetComponent <Skills>().damage *MetaScript.getGlobal_Stats().getMilitaryAbility();
            target.GetComponent <Health>().damage(Mathf.RoundToInt(damage));
        }
    }
Esempio n. 3
0
 protected override void slow(GameObject victim)
 {
     if (!MetaScript.getGlobal_Stats().getHasHeatProtection())
     {
         InBuilding shelterCheck = victim.GetComponent <InBuilding>();
         if (shelterCheck == null || !shelterCheck.getPlayerInBuilding())
         {
             buffsys.slowApplyingSystem(victim, slowDuration, slowDecimal);
         }
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (inCombat && timeControl)
     {
         StartCoroutine(combatManager());
     }
     if (originalMultiplier < MetaScript.getGlobal_Stats().getAtkMultiplier())
     {
         originalMultiplier = MetaScript.getGlobal_Stats().getAtkMultiplier();
         damage             = Mathf.RoundToInt(baseDamage * originalMultiplier);
     }
 }
Esempio n. 5
0
 void Update()
 {
     if (originalHealthMultiplier != MetaScript.getGlobal_Stats().getHealthMultiplier() && gameObject.tag == "OwnedNPC")
     {
         originalHealthMultiplier = MetaScript.getGlobal_Stats().getHealthMultiplier();
         Debug.Log(originalHealthMultiplier);
         Debug.Log(MetaScript.getGlobal_Stats().getHealthMultiplier());
         health    = Mathf.RoundToInt(originalMaxHp * originalHealthMultiplier);
         maxHealth = health;
     }
     if (health <= 0 && !isImmortal)
     {
         death();
     }
 }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        bool isProtected = MetaScript.getGlobal_Stats().getHasColdProtection();

        if (!isProtected)
        {
            timePassed += Time.deltaTime;
            if (timePassed >= tickTime)
            {
                timePassed = 0;

                heatExhaust(player);

                List <GameObject> NPCs = MetaScript.getMeta().GetComponent <OwnedNPCList>().getNPCs();
                for (int i = 0; i < NPCs.Count; i++)
                {
                    heatExhaust(NPCs[i]);
                }
            }
        }
    }
Esempio n. 7
0
    private void useFood()
    {
        float foodSaved   = MetaScript.getGlobal_Stats().getFoodSaved();
        int   currentFood = resourceManager.getResource(ResourceTypes.FOOD);
        float foodCost    = (ownedNPC.getCount() + 1) * foodUsedPerNPC - foodSaved;

        Debug.Log("Food used =" + foodCost);
        if (foodCost < 0)
        {
            foodCost = 0;
        }
        if (resourceManager.hasResource(ResourceTypes.FOOD, (int)foodCost))
        {
            resourceManager.addResource(ResourceTypes.FOOD, (int)-foodCost);
            applyGlobalSlowRegen();
            noFood = false;
        }
        else
        {
            resourceManager.addResource(ResourceTypes.FOOD, -currentFood);
            noFood = true;
        }
    }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setMilitaryAbility(MetaScript.getGlobal_Stats().getMilitaryAbility() + militaryAbility);
 }
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setGatherMultiplier(multiplier * MetaScript.getGlobal_Stats().getBaseGather());
 }
Esempio n. 10
0
 public override void removeStorm()
 {
     MetaScript.getMeta().GetComponent <Global_Stats>().setGatherMultiplier(MetaScript.getGlobal_Stats().getBaseGather());
     Destroy(gameObject);
 }
Esempio n. 11
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setBaseGather(MetaScript.getGlobal_Stats().getBaseGather() + gatherIncrease);
 }
Esempio n. 12
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setAtkMultiplier(multiplierToAdd);
 }
Esempio n. 13
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setHasColdProtection(true);
 }
Esempio n. 14
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setFoodSaved(MetaScript.getGlobal_Stats().getFoodSaved() + foodConsumption);
 }