Monster类

来源:互联网 发布:剑三魏无羡捏脸数据 编辑:程序博客网 时间:2024/06/04 17:41

  Monster类

  1 using System;

  2 using System.Collections.Generic;

  3 using System.Linq;

  4 using System.Text;

  5

  6 namespace IGameLiAdv

  7 {成都红牌楼治疗阳痿医院哪个好
成都看前列腺炎到哪家医院好
宫颈糜烂一定要做手术吗?
成都茶店子人流去哪家医院
在成都做阴茎延长术有没有风险
成都龙泉治早泄的正规医院
成都红星路好的无痛人流医院
成都驷马桥做人流需要多少钱
在成都做个阴茎延长要多少钱
治疗月经不调成都哪个医院好
做妇科检查在成都哪儿的医院好
成都金堂做阴茎延长术大概需要多少钱
成都太升路无痛人流医院哪家好
成都武侯做阴茎延长术要多少钱
成都看早泄去哪家医院会好一些

  8 ///

  9 /// 怪物

  10 ///

  11 internal sealed class Monster

  12 {

  13 ///

  14 /// 怪物的名字

  15 ///

  16 public String Name { get; set; }

  17

  18 ///

  19 /// 怪物的生命值

  20 ///

  21 private Int32 HP { get; set; }

  22

  23 public Monster(String name,Int32 hp)

  24 {

  25 this.Name = name;

  26 this.HP = hp;

  27 }

  28

  29 ///

  30 /// 怪物被攻击时,被调用的方法,用来处理被攻击后的状态更改

  31 ///

  32 /// 此次攻击损失的HP

  33 public void Notify(Int32 loss)

  34 {

  35 if (this.HP <= 0)

  36 {

  37 Console.WriteLine("此怪物已死");

  38 return;

  39 }

  40

  41 this.HP -= loss;

  42 if (this.HP <= 0)

  43 {

  44 Console.WriteLine("怪物" + this.Name + "被打死");

  45 }

  46 else

  47 {

  48 Console.WriteLine("怪物" + this.Name + "损失" + loss + "HP");

  49 }

  50 }

  51 }

  52 }

原创粉丝点击