Exemplo n.º 1
0
 public NiPSBombForce()
 {
     decay        = 0.0f;
     deltaV       = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
     bombObject   = null;
 }
Exemplo n.º 2
0
 public NiPSysBombModifier()
 {
     bombObject   = null;
     decay        = 0.0f;
     deltaV       = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
 }
Exemplo n.º 3
0
 public NiParticleBomb()
 {
     decay        = 0.0f;
     duration     = 0.0f;
     deltav       = 0.0f;
     start        = 0.0f;
     decayType    = (DecayType)0;
     symmetryType = (SymmetryType)0;
 }
Exemplo n.º 4
0
 public NiParticleBomb(NiFile niFile) : base(niFile)
 {
     decay     = niFile.Reader.ReadSingle();
     duration  = niFile.Reader.ReadSingle();
     deltaV    = niFile.Reader.ReadSingle();
     start     = niFile.Reader.ReadSingle();
     decayType = (DecayType)niFile.Reader.ReadInt32();
     position  = niFile.Reader.ReadVector3();
     direction = niFile.Reader.ReadVector3();
 }
Exemplo n.º 5
0
 public NiParticleBomb(NIFReader file, BinaryReader reader) : base(file, reader)
 {
     Decay        = reader.ReadSingle();
     Duration     = reader.ReadSingle();
     DeltaV       = reader.ReadSingle();
     Start        = reader.ReadSingle();
     DecayType    = (DecayType)reader.ReadUInt32();
     SymmetryType = (SymmetryType)reader.ReadUInt32();
     Position     = reader.Read <Vector3>();
     Direction    = reader.Read <Vector3>();
 }
Exemplo n.º 6
0
    public Status(string name, string desc, Sprite icon, DecayType dt, int stacksMax, float duration, params StatusComponent[] components)
    {
        this.name      = name;
        this.desc      = desc;
        this.icon      = icon;
        this.decayType = dt;
        initDuration   = duration;
        _duration      = initDuration;

        this.stacksMax = stacksMax;
        _stacks        = 1;

        this.components = components;
        for (int i = 0; i < components.Length; i++)
        {
            this.components [i].setParent(this).stacks = stacks;
        }
    }
Exemplo n.º 7
0
    public void Depreciate(float dt, DecayType myDecayType, bool inTerritory)
    {
        if (myDecayType == DecayType.ACTIVE)
        {
            if (inTerritory)
            {
                sleep      -= dt * activeInTerritoryDecayRates.sleepRate;
                hunger     -= dt * activeInTerritoryDecayRates.hungerRate;
                education  -= dt * activeInTerritoryDecayRates.educationRate;
                wanderLust += dt * activeInTerritoryDecayRates.wanderLustRate;
            }
            else
            {
                sleep      -= dt * activeOutTerritoryDecayRates.sleepRate;
                hunger     -= dt * activeOutTerritoryDecayRates.hungerRate;
                education  -= dt * activeOutTerritoryDecayRates.educationRate;
                wanderLust -= dt * activeOutTerritoryDecayRates.wanderLustRate;
            }
        }
        else
        {
            if (inTerritory)
            {
                sleep      -= dt * passiveInTerritoryDecayRates.sleepRate;
                hunger     -= dt * passiveInTerritoryDecayRates.hungerRate;
                education  -= dt * passiveInTerritoryDecayRates.educationRate;
                wanderLust += dt * passiveInTerritoryDecayRates.wanderLustRate;
            }
            else
            {
                sleep      -= dt * passiveOutTerritoryDecayRates.sleepRate;
                hunger     -= dt * passiveOutTerritoryDecayRates.hungerRate;
                education  -= dt * passiveOutTerritoryDecayRates.educationRate;
                wanderLust -= dt * passiveOutTerritoryDecayRates.wanderLustRate;
            }
        }


        sleep      = Mathf.Clamp(sleep, 0, 100);
        hunger     = Mathf.Clamp(hunger, 0, 100);
        education  = Mathf.Clamp(education, 0, 125);
        wanderLust = Mathf.Clamp(wanderLust, 0, 100);
    }
Exemplo n.º 8
0
Arquivo: Status.cs Projeto: pffft/ld42
        public Status(string name, string desc, Sprite icon, DecayType dt, int stacksMax, float duration, params StatusComponent[] comps)
        {
            this.name = name;
            this.desc = desc;
            this.icon = icon;

            decayType     = dt;
            initDuration  = duration;
            this.duration = initDuration;

            this.stacksMax = stacksMax;
            stacks         = 1;

            components = new Dictionary <Type, StatusComponent> ();
            foreach (StatusComponent sc in comps)
            {
                sc.setParent(this).stacks = stacks;
                components.Add(sc.GetType(), sc);
            }
        }
Exemplo n.º 9
0
    public Status(string name, string desc, string iconPath, DecayType dt, int stacksMax, float duration, params StatusComponent[] components)
    {
        this.name     = name;
        this.desc     = desc;
        this.iconPath = iconPath;
        this.icon     = ABU.LoadAsset <Sprite> (ICON_DIR, iconPath);

        decayType     = dt;
        initDuration  = duration;
        this.Duration = initDuration;

        this.StacksMax = stacksMax;
        Stacks         = 1;

        this.components = components;
        for (int i = 0; i < components.Length; i++)
        {
            this.components [i].SetParent(this).stacks = Stacks;
        }
    }
Exemplo n.º 10
0
    /* Static Methods */


    /* Constructors */
    public Status(string name, string desc, string iconPath, DecayType dt, int stacksMax, float duration, params StatusComponent[] components)
    {
        this.name     = name;
        this.desc     = desc;
        this.iconPath = iconPath;
        this.icon     = Resources.Load <Sprite> (iconPath);

        decayType     = dt;
        initDuration  = duration;
        this.duration = initDuration;

        this.stacksMax = stacksMax;
        stacks         = 1;

        this.components = new StatusComponent[components.Length];
        for (int i = 0; i < components.Length; i++)
        {
            this.components[i]         = new StatusComponent(components[i]);
            this.components [i].stacks = stacks;
        }
    }
Exemplo n.º 11
0
        private void PpuOpenBusDecay(DecayType action)
        {
            switch (action)
            {
            case DecayType.None:
                for (int i = 0; i < 8; i++)
                {
                    if (ppu_open_bus_decay_timer[i] == 0)
                    {
                        ppu_open_bus = (byte)(ppu_open_bus & (0xff - (1 << i)));
                        ppu_open_bus_decay_timer[i] = 1786840;                                 // about 1 second worth of cycles
                    }
                    else
                    {
                        ppu_open_bus_decay_timer[i]--;
                    }
                }
                break;

            case DecayType.All:
                for (int i = 0; i < 8; i++)
                {
                    ppu_open_bus_decay_timer[i] = 1786840;
                }
                break;

            case DecayType.High:
                ppu_open_bus_decay_timer[7] = 1786840;
                ppu_open_bus_decay_timer[6] = 1786840;
                ppu_open_bus_decay_timer[5] = 1786840;
                break;

            case DecayType.Low:
                for (int i = 0; i < 6; i++)
                {
                    ppu_open_bus_decay_timer[i] = 1786840;
                }
                break;
            }
        }
Exemplo n.º 12
0
    public Status(SerializationInfo info, StreamingContext context)
    {
        name     = info.GetString("name");
        desc     = info.GetString("desc");
        iconPath = info.GetString("icon");
        icon     = Resources.Load <Sprite> (iconPath);

        decayType    = (DecayType)info.GetInt32("decayType");
        initDuration = info.GetSingle("initDuration");
        duration     = info.GetSingle("duration");

        stacksMax = info.GetInt32("stacksMax");
        stacks    = info.GetInt32("stacks");

        int numComponents = info.GetInt32("numComponents");

        this.components = new StatusComponent[numComponents];
        for (int i = 0; i < numComponents; i++)
        {
            components[i] = (StatusComponent)info.GetValue("component" + i, typeof(StatusComponent));
        }
    }
Exemplo n.º 13
0
    void CheckPriorities()
    {
        DecayType myDecayType = DecayType.PASSIVE;

        if (inControl)
        {
            myDecayType = DecayType.ACTIVE;
        }


        myPriorities.Depreciate(Time.deltaTime, myDecayType, inTerritory);

        //high
        if (Priorities.education > 100)
        {
            expMultiplier          = 2.0f;
            myStatusEffects.dimWit = 0;
            myStatusEffects.genius = 1;
        }
        else if (myStatusEffects.genius == 1)
        {
            myStatusEffects.genius = 0;
            expMultiplier          = 1.0f;
        }

        //low education -> dullness
        if (Priorities.education > stageOnePriorityPenalty)
        {
            if (myStatusEffects.dimWit != 0)
            {
                expMultiplier         += myStatusEffects.dimWit * .25f;
                myStatusEffects.dimWit = 0;
            }
        }
        else if (Priorities.education > stageTwoPriorityPenalty)
        {
            if (myStatusEffects.dimWit != 1)
            {
                expMultiplier         += myStatusEffects.dimWit * .25f;
                myStatusEffects.dimWit = 1;
                expMultiplier         -= myStatusEffects.dimWit * .25f;
            }
        }
        else if (Priorities.education > stageThreePriorityPenalty)
        {
            if (myStatusEffects.dimWit != 2)
            {
                expMultiplier         += myStatusEffects.dimWit * .25f;
                myStatusEffects.dimWit = 2;
                expMultiplier         -= myStatusEffects.dimWit * .25f;
            }
        }
        else if (myStatusEffects.dimWit != 3)
        {
            expMultiplier         += myStatusEffects.dimWit * .25f;
            myStatusEffects.dimWit = 3;
            expMultiplier         -= myStatusEffects.dimWit * .25f;
        }


        //low hunger -> starvation
        if (myPriorities.hunger > stageOnePriorityPenalty)
        {
            myStatusEffects.starvation = 0;
        }
        else if (myPriorities.hunger > stageTwoPriorityPenalty)
        {
            myStatusEffects.starvation = 1;
        }
        else if (myPriorities.hunger > stageThreePriorityPenalty)
        {
            myStatusEffects.starvation = 2;
        }
        else
        {
            myStatusEffects.starvation = 3;
        }


        //low sleep -> sleep deprevation
        if (myPriorities.sleep > stageOnePriorityPenalty)
        {
            if (myStatusEffects.sleepDerpivation != 0)
            {
                healingMultiplier += .25f + myStatusEffects.sleepDerpivation * .25f;
                myStatusEffects.sleepDerpivation = 0;
            }
        }
        else if (myPriorities.sleep > stageTwoPriorityPenalty)
        {
            if (myStatusEffects.sleepDerpivation != 1)
            {
                if (myStatusEffects.sleepDerpivation == 0)
                {
                    healingMultiplier -= .25f;
                }

                healingMultiplier += myStatusEffects.sleepDerpivation * .25f;
                myStatusEffects.sleepDerpivation = 1;
                healingMultiplier -= myStatusEffects.sleepDerpivation * .25f;
            }
        }
        else if (myPriorities.sleep > stageThreePriorityPenalty)
        {
            if (myStatusEffects.sleepDerpivation != 2)
            {
                healingMultiplier += myStatusEffects.sleepDerpivation * .25f;
                myStatusEffects.sleepDerpivation = 2;
                healingMultiplier -= myStatusEffects.sleepDerpivation * .25f;
            }
        }
        else if (myStatusEffects.sleepDerpivation != 3)
        {
            healingMultiplier += myStatusEffects.sleepDerpivation * .25f;
            myStatusEffects.sleepDerpivation = 3;
            healingMultiplier -= myStatusEffects.sleepDerpivation * .25f;
        }

        //if wanderlust->high
        if (myPriorities.wanderLust >= 95f)
        {
            myStatusEffects.homeSick  = 0;
            myStatusEffects.stirCrazy = 1;
        }
        else
        {
            myStatusEffects.stirCrazy = 0;
        }

        //low wanderLust -> homeSick
        if (myPriorities.wanderLust > stageOnePriorityPenalty)
        {
            if (myStatusEffects.homeSick != 0)
            {
                myStatusEffects.homeSick = 0;
                lockAllAttacks(false);
            }
        }
        else if (myPriorities.wanderLust > stageTwoPriorityPenalty)
        {
            if (myStatusEffects.homeSick == 0)         //set up stage 1 lock
            {
                int randomLock = UnityEngine.Random.Range(0, 3);
                attackLock[randomLock]   = true;
                previousLocks[0]         = randomLock;
                myStatusEffects.homeSick = 1;
            }
            else if (myStatusEffects.homeSick == 2)
            {
                attackLock[previousLocks[1]] = false;              //unlock stage 2's lock
                myStatusEffects.homeSick     = 1;
            }
        }
        else if (myPriorities.wanderLust > stageThreePriorityPenalty)
        {
            if (myStatusEffects.homeSick == 1)         //set up stage 2 lock
            {
                int randomLock = UnityEngine.Random.Range(0, 3);

                if (randomLock == previousLocks[0])             //prevent re lock
                {
                    randomLock++; randomLock %= 4;
                }

                attackLock[randomLock]   = true;
                previousLocks[1]         = randomLock;
                myStatusEffects.homeSick = 2;
            }
            else if (myStatusEffects.homeSick == 3)
            {
                attackLock[previousLocks[2]] = false;              //unlock stage 3's lock
                myStatusEffects.homeSick     = 2;
            }
        }
        else if (myStatusEffects.homeSick != 3)
        {
            int randomLock = UnityEngine.Random.Range(0, 3);

            while (randomLock == previousLocks[0] || randomLock == previousLocks[1])       //prevent re lock
            {
                randomLock++; randomLock %= 4;
            }

            attackLock[randomLock]   = true;
            previousLocks[2]         = randomLock;
            myStatusEffects.homeSick = 3;
        }


        //preserve current health  between tranfusion, since deltaStats shouldn't have anything to do with it
        float currentHealth = currentStats.health;

        currentStats.SetEqual(baseStats + deltaStats);
        currentStats.health = currentHealth;
    }