Inheritance: ModifiedStat
        public FormClasses()
        {
            InitializeComponent();

            pData        = new Classe();
            IncrementTab = new Increment();
            BasicTab     = new Basic();
            StatTab      = new BaseStat();
            VitalTab     = new Vital();
            PhysicalTab  = new Physical();
            MagicTab     = new Magic();
            ExtraTab     = new Extra();
            ElementalTab = new Elemental();
            ResistTab    = new Resist();

            DockPanel.AddContent(BasicTab);
            DockPanel.AddContent(StatTab);
            DockPanel.AddContent(VitalTab);
            DockPanel.AddContent(PhysicalTab);
            DockPanel.AddContent(MagicTab);
            DockPanel.AddContent(ElementalTab);
            DockPanel.AddContent(ResistTab);
            DockPanel.AddContent(ExtraTab);

            DockPanel.ContentRemoved += DockPanel_ContentRemoved;
        }
Exemple #2
0
 public GameMessagePrivateUpdateAttribute2ndLevel(Session session, Vital vital, uint value)
     : base(GameMessageOpcode.PrivateUpdateAttribute2ndLevel, GameMessageGroup.Group09)
 {
     Writer.Write(session.UpdateAttribute2ndLevelSequence++);
     Writer.Write((uint)vital);
     Writer.Write(value);
 }
Exemple #3
0
        public GameEventPrivateUpdateVital(Session session, Entity.Enum.Ability vital, uint ranks, uint baseValue, uint totalInvestment, uint currentValue)
            : base(session)
        {
            switch (vital)
            {
            case Entity.Enum.Ability.Health:
                this.vital = Vital.Health;
                break;

            case Entity.Enum.Ability.Stamina:
                this.vital = Vital.Stamina;
                break;

            case Entity.Enum.Ability.Mana:
                this.vital = Vital.Mana;
                break;

            default:
                throw new ArgumentException("invalid vital specified");
            }
            this.ranks           = ranks;
            this.baseValue       = baseValue;
            this.totalInvestment = totalInvestment;
            this.currentValue    = currentValue;
        }
Exemple #4
0
 public GameMessagePrivateUpdateAttribute2ndLevel(WorldObject worldObject, Vital vital, uint value)
     : base(GameMessageOpcode.PrivateUpdateAttribute2ndLevel, GameMessageGroup.UIQueue)
 {
     Writer.Write(worldObject.Sequences.GetNextSequence(Sequence.SequenceType.UpdateAttribute2ndLevel, vital));
     Writer.Write((uint)vital);
     Writer.Write(value);
 }
Exemple #5
0
 public void SetVitalAt(int index, Vital vital)
 {
     if (index < _vital.Length && index > -1)
     {
         _vital[index] = vital;
     }
 }
        public FormIncrement()
        {
            InitializeComponent();

            pData        = new Classe();
            IncrementTab = new Increment();
            //muda o modo de edição para incremento
            BasicTab = new Basic();
            BasicTab.IsClasseMode = false;

            StatTab      = new BaseStat();
            VitalTab     = new Vital();
            PhysicalTab  = new Physical();
            MagicTab     = new Magic();
            ExtraTab     = new Extra();
            ElementalTab = new Elemental();
            ResistTab    = new Resist();

            DockPanel.AddContent(BasicTab);
            DockPanel.AddContent(StatTab);
            DockPanel.AddContent(VitalTab);
            DockPanel.AddContent(PhysicalTab);
            DockPanel.AddContent(MagicTab);
            DockPanel.AddContent(ElementalTab);
            DockPanel.AddContent(ResistTab);
            DockPanel.AddContent(ExtraTab);

            DockPanel.ContentRemoved += DockPanel_ContentRemoved;
        }
Exemple #7
0
 public void SetUp(CharacterCreator creator, int index, Vital vit)
 {
     vitalIndex     = index;
     charCreator    = creator;
     titleText.text = ((VitalName)index).ToString();
     valueText.text = vit.AdjustedBaseValue.ToString();
 }
Exemple #8
0
        /// <summary>
        /// Clients receive reports about health as part of their incoming streams. The server will have added them to its outgoing/mirror streams.
        /// </summary>
        public void NSTBitstreamIncomingFirst(Frame frame, Frame currFrame, ref UdpBitStream bitstream, bool isServer)
        {
            bool iAmActingAuthority = na.IAmActingAuthority;
            // If this is the server and has authority, it will receieve its own outgoings... account for that.
            // TODO: Cache this down the line with callbacks from the net engine to notify of ownership changes
            bool noIncomingExpected =
                MasterNetAdapter.ServerIsActive &&
                iAmActingAuthority &&
                (NetLibrarySettings.single.defaultAuthority == DefaultAuthority.ServerAuthority || MasterNetAdapter.NET_MODEL == NetworkModel.ServerClient) &&
                !na.IsMine;

            // if we are authority, any incoming messages from others will not include a health. Only the authority should write health.
            if (noIncomingExpected)
            {
                return;
            }

            if (UpdateDue(frame.frameid))
            {
                for (int i = 0; i < vitalsCount; ++i)
                {
                    Vital v      = vitals[i];
                    int   incval = bitstream.ReadInt(v.bitsForStat);
                    if (!iAmActingAuthority)
                    {
                        v.Value = incval;
                    }
                }

                if (!iAmActingAuthority)
                {
                    UpdateMonitors();
                }
            }
        }
        public void UpdateGraphics(IVitals vitals)
        {
            Vital vital = vitals[monitoredVitalId];

            if (vital == null)
            {
                return;
            }

            if (UIText != null)
            {
                UIText.text = ((int)vital.Value).ToString();
            }

            // Resize the healthbar
            if (UIImage != null)
            {
                if (UIImage.type == Image.Type.Filled && UIImage.sprite != null)
                {
                    UIImage.fillAmount = vital.Value / vital.maxValue;
                }
                else
                {
                    UIImage.rectTransform.localScale = new Vector3(
                        vital.Value / vital.maxValue,
                        UIImage.rectTransform.localScale.y,
                        UIImage.rectTransform.localScale.z);
                }
            }
        }
        private void AddIndicatorWindow(VitalIndicator indicator, Vital monitoringVital)
        {
            var borderedIndicator = new BorderedVitalIndicator(indicator, this.indicatorWidth, this.indicatorHeight);
            var indicatorWindow   = new IndicatorWindow(borderedIndicator, monitoringVital, (indicator.Width - 70.0), indicator.Height);

            indicatorWindows.Add(indicatorWindow);
        }
Exemple #11
0
    public void ApplyDamage(float amount)
    {
        Vital shield = GetVital(VitalType.ShieldPoints);
        Vital hull   = GetVital(VitalType.HullPoints);

        if (hull.current <= 0f)
        {
            return;
        }

        if (shield.current >= amount)
        {
            shield.Update(-amount);
        }
        else if (shield.current > 0)
        {
            amount -= shield.current;

            shield.Update(-shield.current);
            hull.Update(-amount);
        }
        else
        {
            hull.Update(-amount);
        }

        OnVitalChanged?.Invoke(VitalType.ShieldPoints, shield.inPercent);
        OnVitalChanged?.Invoke(VitalType.HullPoints, hull.inPercent);
    }
Exemple #12
0
        public async Task <ActionResult <Vital> > PostVital(Vital vital)
        {
            _context.Vital.Add(vital);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetVital", new { id = vital.Id }, vital));
        }
Exemple #13
0
    // ------------------------------------------------------------------------------- //

    // ------------------------- Controls stamina functionality ------------------------- //
    private void StaminaController(Vital vital)
    {
        bool running = false;

        if (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.W)) // if left shift is pressed AND player is moving forward
        {
            // set running to true, increase players speed, and begin depleting stamina
            running = true;
            playerMovement.moveSpeed = 10f;
            vital.slider.value      -= Time.deltaTime * vital.fallRate;
        }
        else if (Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.W)) // if left shift is not pressed anymore
        {
            // set running to false, and players speed back to normal
            running = false;
            playerMovement.moveSpeed = 5f;
        }

        if (!running) // if not running, regenerate stamina
        {
            vital.slider.value += Time.deltaTime * vital.fallRate;
        }

        if (vital.slider.value <= 0) // if stamina is fully depleted, keep at 0 (until left shift is let go), and players speed back to normal
        {
            vital.slider.value       = 0;
            playerMovement.moveSpeed = 5f;
        }
        else if (vital.slider.value >= vital.max) // if stamina is at the max, keep it there (until shift is pressed again, this is if we have a consumable that gives stamina)
        {
            vital.slider.value = vital.max;
        }
    }
 public GameMessagePrivateUpdateAttribute2ndLevel(Session session, Vital vital, uint value)
     : base(GameMessageOpcode.PrivateUpdateAttribute2ndLevel, GameMessageGroup.Group09)
 {
     Writer.Write(session.Player.Sequences.GetNextSequence(Sequence.SequenceType.PrivateUpdateAttribute2ndLevel));
     Writer.Write((uint)vital);
     Writer.Write(value);
 }
Exemple #15
0
        public async Task <IActionResult> PutVital(int id, Vital vital)
        {
            if (id != vital.Id)
            {
                return(BadRequest());
            }

            _context.Entry(vital).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!VitalExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
 private void SetupVitals()
 {
     for (int i = 0; i < _vital.Length; i++)
     {
         _vital[i] = new Vital();
     }
 }
Exemple #17
0
 /// FillableBar()
 public static void FillableBar(Rect rect, float percent, Vital vital, Color fillColor)
 {
     WindowComponents.DrawTextureWithBorder(rect, Res.textures["fillable_border"]);
     rect = rect.Contract(2f);
     GUI.DrawTexture(rect.Width(rect.width * percent), Res.TextureUnicolor(fillColor));
     GUI.Label(rect, Mathf.Round(vital.currentValue).ToString() + " / " + vital.value.ToString(), WindowComponents.vitalLabelStyle);
 }
 private void SetupVitals()
 {
     for (int cnt = 0; cnt < vital.Length; cnt++)
     {
         vital[cnt] = new Vital();
     }
 }
    private void SetupVitals()
    {
        for (int cnt = 0; cnt < _vital.Length; cnt++)
            _vital[cnt] = new Vital();

        SetupVitalModifiers();        
    }
Exemple #20
0
    void DisplayStatValues()
    {
        Text   displayText;
        string toDisplay = "NaN";

        ForEachEnum <StatType>((statType) => {
            Stat stat = stats.GetStat((StatType)statType);
            if (stat != null)
            {
                Vital vital = stat as Vital;

                if (vital != null)
                {
                    Debug.Log(string.Format("Stat {0}'s value is {1}/{2}",
                                            vital.StatName, vital.StatCurrentValue, vital.StatValue));
                    toDisplay = vital.StatCurrentValue + "/" + vital.StatValue;
                }
                else
                {
                    Debug.Log(string.Format("Stat {0}'s value is {1}",
                                            stat.StatName, stat.StatValue));
                    toDisplay = stat.StatValue.ToString();
                }
                displayText      = GameObject.Find(stat.StatName + "_Value").GetComponent <Text>();
                displayText.text = toDisplay;
            }
        });
    }
Exemple #21
0
 /// <summary>
 /// Initializes the vitals for this character.
 /// </summary>
 private void SetupVitals()
 {
     for (int i = 0; i < vitals.Length; i++)
     {
         vitals[i] = new Vital(50, 0, 50, Enum.GetName(typeof(VitalName), i));
     }
 }
Exemple #22
0
 private void SetupVitals()
 {
     for (int cnt = 0; cnt < _vital.Length; cnt++)
     {
         _vital[cnt] = new Vital();
     }
     SetupVitalModifiers();
 }
Exemple #23
0
 private void SetUpVitals()
 {
     for (int i = 0; i < _vitals.Length; i++)
     {
         _vitals[i] = new Vital();
     }
     SetUpVitalModifiers();
 }
Exemple #24
0
 private void SetupVitals()
 {
     for (int cnt = 0; cnt < _vitals.Length; cnt++)
     {
         _vitals[cnt]      = new Vital();
         _vitals[cnt].Name = ((VitalName)cnt).ToString();
     }
 }
Exemple #25
0
        public ActionResult DeleteConfirmed(int id)
        {
            Vital vital = db.Vitals.Find(id);

            db.Vitals.Remove(vital);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #26
0
    public void SaveVital(Vital vital, string path)
    {
        print("saving vital (" + vital.name + ") in: " + path);
        var serializer = new XmlSerializer(typeof(Vital));
        var stream     = new FileStream(Path.GetFullPath(Application.dataPath) + path, FileMode.Create);

        serializer.Serialize(stream, vital);
        stream.Close();
    }
    void Reset()
    {
        _buffTime = 0;

        for(int i = 0; i < _vitals.Length; i++) {
            _vitals[i] = new Vital();
            _amountToHeal[i] = 0;
        }
    }
Exemple #28
0
        /// FillableBarWithLabelValue
        public static void FillableBarWithLabelValue(Rect rect, string name, Vital vital, Color fillColor)
        {
            float percent = Utils.Normalize(0, vital.value, vital.currentValue);

            Rect[] hGrid = rect.HorizontalGrid(new float[] { 70, rect.width - 140, 70 }, 5);
            WindowComponents.Label(hGrid[1], name);
            WindowComponents.FillableBar(hGrid[2], percent, vital, fillColor);
            WindowComponents.Label(hGrid[3], Mathf.Round(percent * 100).ToString() + "%");
        }
Exemple #29
0
    void OnStatValueChange(object sender, EventArgs args)
    {
        Vital vital = (Vital)sender;

        if (vital != null)
        {
            vital.StatCurrentValue = vital.StatValue;
        }
    }
Exemple #30
0
    private void Reset()
    {
        _buffTime = 0;

        for(int cnt = 0; cnt < _vital.Length; cnt++) {
            _vital[cnt] = new Vital();
            _amountToHeal[cnt] = 0;
        }
    }
Exemple #31
0
    public void SetupVitals()
    {
        for (int cnt = 0; cnt < vital.Length; cnt++)
        {
            vital[cnt] = new Vital();
        }

        SetupVitalModifiers();
    }
Exemple #32
0
 public void Reset()
 {
     _buffTime = 0;
     for(int i = 0; i < _vitals.Length; i++)
     {
         _vitals[i] = new Vital();
         _effectAmount[i] = 0;
     }
 }
Exemple #33
0
    public void Reset()
    {
        _buffTime = 0;

        for (int cnt = 0; cnt < _vital.Length; cnt++)
        {
            _vital[cnt]        = new Vital();
            _amountToHeal[cnt] = 0;
        }
    }
Exemple #34
0
    public VitalsDict()
    {
        Vital bpm       = new Vital("BPM", 70.00f, 150.00f);
        Vital RespoRate = new Vital("RespoRate", 30.00f, 95.00f);
        Vital Spo2      = new Vital("Spo2", 90.00f, 101.00f);

        dict.Add("BPM", bpm);
        dict.Add("RESPORATE", RespoRate);
        dict.Add("SPO2", Spo2);
    }
Exemple #35
0
 public void SetVitalAndEffectAt(int index, Vital v, int effect)
 {
     SetVitalAt(index, v);
     SetEffectAt(index, effect);
 }
 public static void SaveVitals( Vital[] vital )
 {
     for( int cnt = 0; cnt < vital.Length; cnt++ )
         SaveVital( (VitalName)cnt, vital[cnt] );
 }
 public void SetVitalAt(int index, Vital vital)
 {
     if (index < _vital.Length && index > -1)
         _vital[index] = vital;
 }
 public Consumable(Vital[] v, int[] a, float b)
 {
     _vital = v;
     _amountToHeal = a;
     _buffTime = b;
 }
    private void SetupVitals()
    {
        for(int x = 0; x < _vitals.Length; x++) {
            _vitals[x] = new Vital();
        }

        SetupVitalModifiers();
    }
Exemple #40
0
 public Head (Vital brain) : base (null) {
     this.Organs = new Vital[] {
         brain
     };
 }
Exemple #41
0
    /*
    //This method is called when the gameObject is enabled
    public void OnEnable () {
        if(_isPlayerHealthBar)
            Messenger<int, int>.AddListener("player health update", OnChangeHealthBarSize);
        else {
            ToggleDisplay(false);
            Messenger<int, int>.AddListener("enemy health update", OnChangeHealthBarSize);
            Messenger<bool>.AddListener("show enemy vitalbars", ToggleDisplay);
        }
    }

    //This method is called when the gameObject is disabled
    public void OnDisable () {
        if (_isPlayerHealthBar)
            Messenger<int, int>.RemoveListener("player health update", OnChangeHealthBarSize);
        else {
            Messenger<int, int>.RemoveListener("enemy health update", OnChangeHealthBarSize);
            Messenger<bool>.RemoveListener("show enemy vitalbars", ToggleDisplay);
        }
    }*/
    void UpdateBar(Vital v)
    {
        //		Debug.LogError("UpdateBar: " + v.CurValue);
        _curBarLength = (v.CurValue / v.MaxValue) * _maxBarLength;		//this calculates the current bar length based on player's health %
        _display.pixelInset = CalculatePosition();
    }
 private void SetupVitals()
 {
     for(int cnt = 0; cnt < _vital.Length; cnt++) {
         _vital[cnt] = new Vital();
     }
 }
Exemple #43
0
 public Structural(Vital[] organs, Functional[] attached) {
     this.Organs = organs;
     this.Attached = attached;
 }
Exemple #44
0
    public void AddVital(Vital vital)
    {
        if (vitals == null)
            vitals = new List<Vital>();

        vitals.Add(vital);
    }
Exemple #45
0
 public Body(Vital[] internalOrgans, params Functional[] attachedOrgans)  
     : base (internalOrgans, attachedOrgans) { }
Exemple #46
0
    private void SetupVitals()
    {
        for(int i = 0; i < _vitals.Length; i++){

            _vitals[i] = new Vital();
        }

        SetupVitalModifiers();
    }
 //iterate though all of the characters vitals and set them up for use
 private void SetupVitals()
 {
     for (int x = 0; x < vitals.Length; x++)
     {
         vitals[x] = new Vital();
         vitals[x].Name = ((Vital.VitalNames)x).ToString();
         vitals[x].Description = vitals[x].vitalDescriptions[x];
     }
 }
Exemple #48
0
 public Consumable(Vital[] v, int[] a, float buffTime)
 {
     _vitals = v;
     _effectAmount = a;
     _buffTime = buffTime;
 }
Exemple #49
0
    public static Vital[] LoadVitals()
    {
        Vital[] vital = new Vital[Enum.GetValues(typeof(VitalName)).Length];

        for(int cnt = 0; cnt < vital.Length; cnt++)
            vital[cnt] = LoadVital( (VitalName)cnt );

        return vital;
    }
 public void SetVitalAndHealAt(int index, Vital vital, int heal)
 {
     SetVitalAt(index, vital);
     SetHealAt(index, heal);
 }
Exemple #51
0
 public void SetVitalAt(int index, Vital v)
 {
     if(index < _vitals.Length && index > -1)
         _vitals[index] = v;
 }
 public static void SaveVital( VitalName name, Vital vital )
 {
     PlayerPrefs.SetInt(((VitalName)name).ToString() + BASE_VALUE, vital.BaseValue);
     PlayerPrefs.SetInt(((VitalName)name).ToString() + EXP_TO_LEVEL, vital.ExpToLevel);
     PlayerPrefs.SetInt(((VitalName)name).ToString() + CUR_VALUE, vital.CurValue);
 }
    private void SetVitals()
    {
        for (int cnt = 0; cnt < Vitals.Length; cnt++)
        {
            Vitals[cnt] = new Vital();
        }

        SetupVitalModifiers();
    }