class Hero_Union {
static {
System.out.println("欢迎来到召唤师峡谷!!!");
}
public static void main(String[] args) {
System.out.println("小队语音已启动");
show(new GaiLun());
show(new HuangZi());
show(new HanBing());
show(new ZhaoXin());
HeroUnion hu1 = new GaiLun();
HeroUnion hu2 = new HuangZi();
HeroUnion hu3 = new HanBing();
HeroUnion hu4 = new ZhaoXin();
hu1.hurt();
hu4.hurt();
hu2.hurt();
show1(new Dragon());
show1(new HeXie());
show1(new Snake());
show(new Dragon());
show(new Snake());
GaiLun hu11 = (GaiLun)hu1;
hu11.talk();
HuangZi hu22 = (HuangZi)hu2;
hu22.talk();
ZhaoXin hu44 = (ZhaoXin)hu4;
hu44.talk();
hu3.hurt();
Sound s = new Sound();
for (int i = 1;i<=4 ; i++) {
System.out.println(i);
System.out.println(Hero.skill);
}
hu22.retalk();
Sound s1 = new Sound();
HanBing hu33 = (HanBing)hu3;
hu33.talk();
HeroUnion hu5 = new Dragon();
HeroUnion hu6 = new Snake();
HeroUnion hu7 = new HeXie();
Dragon hu55 = (Dragon)hu5;
Snake hu66 = (Snake)hu6;
HeXie hu77 = (HeXie)hu7;
hu77.taunt();
hu33.retalk();
hu55.taunt();
hu66.taunt();
show(new HeXie());
System.out.println("寒冰发起投降");
for (int i = 1;i<=3 ; i++) {
System.out.println(i);
}
System.out.println("寒冰:想起那日在夕阳下的奔跑是我无悔的青春!!!!");
System.out.println("皇子,赵信,德玛:同感!!!"+"\n"+"寒冰:滚!!!"+"\n"+"皇子,赵信,德玛:额");
}
public static void show1(HeroUnion ha){
ha.hurt();
}
public static void show(HeroUnion hu){
hu.speak();
}
}
//接口
interface HeroUnion {
public static final String area = "峡谷";
public abstract void hurt();
public abstract void speak();
}
//抽象类
abstract class Animal implements HeroUnion{
private String name;
//构造方法
public Animal() {}
public Animal(String name ){
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public String getName(){
return name;
}
public abstract void taunt();
}
class Dragon extends Animal {
public Dragon(){}
public Dragon(String name){
super(name);
}
public void hurt() {
System.out.println("大龙:我具有攻击属性");
}
public void speak(){
System.out.println("大龙:人不犯我,我不犯人.人若犯我,我吐死你!!");
}
public void taunt() {
System.out.println("大龙:放开她,冲我来!!!");
}
}
class Snake extends Dragon {
public Snake(){}
public Snake(String name){
super(name);
}
public void hurt() {
System.out.println("小龙:你怎么看!!!");
}
public void speak(){
System.out.println("小龙:大哥说的对!!!");
}
public void taunt() {
System.out.println("小龙:呵呵!!!");
}
}
class HeXie extends Animal {
public HeXie(){
}
public HeXie(String name){
super("河蟹");
}
public void hurt(){
System.out.println("河蟹:我没有攻击属性");
}
public void taunt() {
System.out.println("河蟹:为什么追我???");
}
public void speak(){
System.out.println("河蟹:大哥,二哥,三弟去也.");
}
}
//接口
abstract class Hero implements HeroUnion {
public static final String skill = "................重生";
private String name;
private String level;
public Hero(){}
public Hero(String name, String level){
this.name = name;
this.level = level;
}
public void setName(String name) {
this.name = name;
}
public String getName(){
return name;
}
public void setLevel(String level) {
this.level = level;
}
public String getLevel(){
return level;
}
public abstract void talk();
public abstract void speak();
public abstract void hurt();
}
class GaiLun extends Hero {
public GaiLun(){}
public GaiLun(String name,String level) {
super("盖伦","1级");
}
public void talk(){
System.out.println("德玛:杀");
}
public void speak(){
System.out.println("德玛:人在塔在!");
}
public void hurt() {
System.out.println("德玛:怎么干?");
}
{
System.out.println("敌方还有30秒到达战场,碾碎他们!!!");
}
}
class HuangZi extends Hero {
public HuangZi(){}
public HuangZi(String name,String level) {
super("皇子","1级");
}
public void talk(){
System.out.println("皇子:赵信上啊,快顶不住了!!!");
}
public void speak(){
System.out.println("皇子:德玛西亚万岁!");
}
public void hurt() {
System.out.println("皇子:大龙团,一起");
}
public void retalk(){
System.out.println("皇子:一起上啊,目标要明确.这次干小龙!!!");
}
}
class ZhaoXin extends Hero {
public ZhaoXin(){
super("赵信","1级");
}
public void talk(){
System.out.println("赵信:不好意思,爆错菊花了!!!");
}
public void speak(){
System.out.println("赵信:犯我德邦着,虽远必诛!");
}
public void hurt() {
System.out.println("赵信:长枪一战");
}
}
class HanBing extends Hero {
public HanBing(){
super("寒冰","1级");
}
public void hurt(){
System.out.println("寒冰:fuck you!!");
}
public void speak(){
System.out.println("寒冰:世间万物,皆系于一剑之上!");
}
public void talk() {
System.out.println("都给我滚!!!");
}
public void retalk(){
System.out.println("寒冰:sorry了!!!");
}
}
class Sound {
{
System.out.println("我方已被团灭!!!");
}
}
|