forked from mastifikator/FantasyJavaPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrc.java
More file actions
121 lines (94 loc) · 3.29 KB
/
Orc.java
File metadata and controls
121 lines (94 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package State;
import java.awt.*;
public class Orc {
private String name;
private OrcStatement orcStatement;
private double strength;
private double speed;
private Color skinColor = Color.GREEN;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getStrength() {
return strength;
}
public void setStrength(double strength) {
this.strength = strength;
}
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public Orc(String name, double strength, double speed) {
this.name = name;
this.strength = strength;
this.speed = speed;
}
public void saidLokTar(){
System.out.println("Лок Тар Огар!");
}
public OrcStatement getOrcStatement(){
return this.orcStatement;
}
public void changeState(OrcStatement orcStatement){
this.orcStatement = orcStatement;
}
public static class OrcChaosStatement extends OrcStatement{
public OrcChaosStatement(Orc orc) {
super(orc);
orc.strength *= 2;
orc.skinColor = Color.RED;
System.out.println("Орк в ярости, получил силу хаоса, теперь его сила равна: " + orc.strength);
}
@Override
public void orcBeat() {
System.out.println("Орк бьёт высекая огонь хаоса!");
}
@Override
public void orcCry() {
System.out.println("Во славу легиона!");
}
}
public static class OrcEatStrangeMushroomStatement extends OrcStatement{
public OrcEatStrangeMushroomStatement(Orc orc) {
super(orc);
orc.speed *= 2;
orc.skinColor = Color.GRAY;
System.out.println("Орк съел непонятных грибов, ему срочно надо... бежать с удвоенной скоростью: " + orc.speed);
}
@Override
public void orcRun() {
System.out.println("Орк бежит роняя кал!");
}
@Override
public void orcCry() {
System.out.println("Лишь бы успеть, орк должен успеть!");
}
}
public static class OrcDrinkVodkaStatement extends OrcStatement{
public OrcDrinkVodkaStatement(Orc orc) {
super(orc);
orc.speed %= 2;
orc.strength %= 2;
orc.skinColor = Color.BLUE;
System.out.println("Орк пьян, его характеристики снизились вдвое, но он очень смел!");
}
@Override
public void orcBeat() {
System.out.println("Я сссамый сиильный ОРК, ОРК-БОСС, щща как дам...ик!");
}
@Override
public void orcRun() {
System.out.println("Ухх ну погодии... дай.. тока.. ща догоню!");
}
@Override
public void orcCry() {
System.out.println("Эхх мнеб Сильвану.. ик.. Мнеб Ветрокрылую!");
}
}
}