forked from H3Gi/tatar-wars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvillage2.php
125 lines (92 loc) · 2.64 KB
/
village2.php
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
122
123
124
125
<?php
require( '.' . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'boot.php' );
class GPage extends ProcessVillagePage {
var $showLevelsStr = null;
function GPage() {
parent::processvillagepage();
$this->viewFile = 'village2.phtml';
$this->contentCssClass = 'village2';
}
function load() {
parent::load();
$cookie = ClientData::getinstance();
$this->showLevelsStr = ($cookie->showLevels ? 'on' : 'off');
}
function getWallCssName() {
if (( $this->buildings[40]['level'] == 0 && $this->buildings[40]['update_state'] == 0 )) {
return 'd2_0';
}
return $this->gameMetadata['tribes'][$this->data['tribe_id']]['wall_css'];
}
function getBuildingName($id) {
$emptyName = '';
switch ($id) {
case 39: {
$emptyName = buildin_place_railpoint;
break;
}
case 40: {
$emptyName = buildin_place_wall;
break;
}
default: {
$emptyName = (( $this->data['is_special_village'] && ( ( ( ( $id == 25 || $id == 26 ) || $id == 29 ) || $id == 30 ) || $id == 33 ) ) ? buildin_place_topbuild : buildin_place_empty);
break;
}
}
return htmlspecialchars( ($this->buildings[$id]['item_id'] == 0 ? $emptyName : constant( 'item_' . $this->buildings[$id]['item_id'] ) . ' ' . level_lang . ' ' . $this->buildings[$id]['level']) );
}
function getBuildingCssName($id) {
$cssName = '';
switch ($id) {
case 39: {
$e = '';
if (( $this->buildings[$id]['level'] == 0 && 0 < $this->buildings[$id]['update_state'] )) {
$e = 'b';
}
else {
if ($this->buildings[$id]['level'] == 0) {
$e = 'e';
}
}
$cssName = 'g' . $this->buildings[$id]['item_id'] . $e;
break;
}
case 25: {
}
case 26: {
}
case 29: {
}
case 30: {
}
case 33: {
if ($this->data['is_special_village']) {
$cssName = 'g40';
if (20 <= $this->buildings[$id]['level']) {
$cssName .= '_' . floor( $this->buildings[$id]['level'] / 20 );
}
break;
}
}
default: {
$e = (( $this->buildings[$id]['level'] == 0 && 0 < $this->buildings[$id]['update_state'] ) ? 'b' : '');
$cssName = ($this->buildings[$id]['item_id'] == 0 ? 'iso' : 'g' . $this->buildings[$id]['item_id'] . $e);
break;
}
}
return $cssName;
}
function getBuildingTitle($id) {
$name = $this->getBuildingName( $id );
return 'title="' . $name . '" alt="' . $name . '"';
}
function getBuildingTitleClass($id) {
$name = $this->getBuildingName( $id );
$cssClass = $this->getBuildingCssName( $id );
return $cssClass . '" alt="' . $name;
}
}
$p = new GPage();
$p->run();
?>