Calculation TEst

an anonymous user · June 24, 2022
using System;

namespace com.DreamTree {
    class Program {
        public static float AttDmg = 100;
        public static float MgcDmg = 50;
        public static float Armor = 30;
        
        public static float CritRate = 50;
        public static float CritFac = 1.5f;
        
        public static float HpAmount = 500;
        public static float MpAmount = 300;
        
        
        public static void Main(string[] args) {
            
            Console.WriteLine(DmgDeal(1));
            Console.WriteLine(DmgDeal(1));
            Console.WriteLine(DmgDeal(1));
            Console.WriteLine(DmgDeal(1));
        }
        
        
        
        //Damage Reduction For Physic Dmg
        public static float DmgReduction(float DmgReceive){
            float a = DmgReceive / (1+Armor/100);
            return a;
        }
        
        public static float DmgDeal(float DmgOut){
            Random rnd = new Random();
            Iscrt = rnd.Next(0,101)
            float crthit = 1f;
            if(crt < CritRate){
                crthit = CritRate
            }
            
            float a = DmgOut*crthit;
            return a;
        }
        
        
    }
}
Output
(Run the program to view its output)

Comments

Please sign up or log in to contribute to the discussion.