Advertisement
AlphaPenguino

csharp/oop/inheritance

Oct 9th, 2024
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace NEwproyeckt
  8. {
  9.     public class Champions
  10.     {
  11.         public int health = 100;
  12.         public int basedamage = 30;
  13.  
  14.         public void Passive()
  15.         {
  16.  
  17.         }
  18.         public void BasicAttack()
  19.         {
  20.             Console.WriteLine(basedamage * 0.25);
  21.         }
  22.         public void firstSkill()
  23.         {
  24.             Console.WriteLine();
  25.         }
  26.         public void secondSkill()
  27.         {
  28.  
  29.         }
  30.         public void thirdSkill()
  31.         {
  32.  
  33.         }
  34.         public void Ultimate()
  35.         {
  36.             Console.WriteLine("Uses his ultimate");
  37.         }
  38.  
  39.     }
  40.  
  41.     public class Melee : Champions
  42.     {
  43.         public int range = 3;
  44.         public int movementspeed = 9;
  45.  
  46.     }
  47.     public class Marksman : Champions
  48.     {
  49.         public int range = 15;
  50.         public int movementspeed = 5;
  51.     }
  52.  
  53.     public class Yasuo : Melee
  54.     {
  55.         public int health = 120;
  56.         public int basedamage = 23;
  57.  
  58.         public double iskillcooldown = 0.24;
  59.         public double iiskillcooldown = 25;
  60.         public int iiiskillcooldown = 25;
  61.         public int ultimate = 125;
  62.         public void BasicAttack()
  63.         {
  64.             Console.WriteLine(basedamage * 0.24);
  65.         }
  66.         public void Ultimate()
  67.         {
  68.             Console.WriteLine("Soryegaton!");
  69.         }
  70.         public void Voiceline()
  71.         {
  72.             Console.WriteLine("Death is like a wind, always by my side");
  73.         }
  74.     }
  75.     public class Vayne : Marksman
  76.     {
  77.         public int health = 120;
  78.         public int basedamage = 23;
  79.  
  80.         public int iskillcooldown = 25;
  81.         public int iiskillcooldown = 25;
  82.         public int iiiskillcooldown = 25;
  83.         public int ultimate = 180;
  84.  
  85.         public void BasicAttack()
  86.         {
  87.             Console.WriteLine(basedamage * 0.24);
  88.         }
  89.         public void Voiceline()
  90.         {
  91.             Console.WriteLine("Let us hunt those who have fallen to Darkness");
  92.         }
  93.     }
  94. }
  95.  
  96. \\\\\\
  97.  
  98. using System;
  99. using NEwproyeckt;
  100. public class main
  101. {
  102.     public static void Main(string[] args)
  103.     {
  104.         Yasuo Player1 = new Yasuo();
  105.         Vayne Player2 = new Vayne();
  106.  
  107.         bfsword item1 = new bfsword();
  108.  
  109.         item1.purchaseItem();
  110.  
  111.         Console.WriteLine(Player1.health);
  112.         Player1.BasicAttack();
  113.        
  114.         Player1.Ultimate();
  115.         Player2.Ultimate();
  116.         Console.WriteLine("Yasuo Range: " + Player1.range);
  117.         Console.WriteLine("Vayne Range: " + Player2.range);
  118.  
  119.         Player1.Voiceline();
  120.     }
  121. }
  122.  
  123. \\\\
  124.  
  125. using System;
  126. using System.Collections.Generic;
  127. using System.Linq;
  128. using System.Text;
  129. using System.Threading.Tasks;
  130.  
  131. namespace NEwproyeckt
  132. {
  133.     public class items
  134.     {
  135.         public String description = "";
  136.  
  137.         public void purchaseItem()
  138.         {
  139.  
  140.         }
  141.         public void sellItem()
  142.         {
  143.  
  144.         }
  145.         public void useItem()
  146.         {
  147.  
  148.         }
  149.     }
  150.    
  151.     public class bfsword : items
  152.     {
  153.         public int dmg = 25;
  154.     }
  155. }
  156.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement