コード例 #1
0
    private void drop()
    {
        float resMult = MetaScript.getGlobal_Stats().getGatherMultiplier();

        curRes = (int)((float)curRes * resMult);
        MetaScript.getRes().addResource(this.findingType, curRes);
        curRes = 0;
    }
コード例 #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));
        }
    }
コード例 #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);
         }
     }
 }
コード例 #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);
     }
 }
コード例 #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();
     }
 }
コード例 #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]);
                }
            }
        }
    }
コード例 #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;
        }
    }
コード例 #8
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setMilitaryAbility(MetaScript.getGlobal_Stats().getMilitaryAbility() + militaryAbility);
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setGatherMultiplier(multiplier * MetaScript.getGlobal_Stats().getBaseGather());
 }
コード例 #10
0
 public override void removeStorm()
 {
     MetaScript.getMeta().GetComponent <Global_Stats>().setGatherMultiplier(MetaScript.getGlobal_Stats().getBaseGather());
     Destroy(gameObject);
 }
コード例 #11
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setBaseGather(MetaScript.getGlobal_Stats().getBaseGather() + gatherIncrease);
 }
コード例 #12
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setAtkMultiplier(multiplierToAdd);
 }
コード例 #13
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setHasColdProtection(true);
 }
コード例 #14
0
 // Use this for initialization
 void Start()
 {
     MetaScript.getGlobal_Stats().setFoodSaved(MetaScript.getGlobal_Stats().getFoodSaved() + foodConsumption);
 }