|
@@ -0,0 +1,43 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: artem
|
|
|
+ * Date: 06.07.18
|
|
|
+ * Time: 20:44
|
|
|
+ */
|
|
|
+
|
|
|
+include_once 'WarUnit.php';
|
|
|
+
|
|
|
+class Guard extends WarUnit
|
|
|
+{
|
|
|
+ protected const POWER = 10;
|
|
|
+
|
|
|
+ public $health;
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ $this->health = 40;
|
|
|
+ $this->decreaseResources();
|
|
|
+ $this->playLoading();
|
|
|
+ }
|
|
|
+
|
|
|
+ private function decreaseResources()
|
|
|
+ {
|
|
|
+ echo '-20 золота<br>';
|
|
|
+ }
|
|
|
+
|
|
|
+ private function playLoading()
|
|
|
+ {
|
|
|
+ echo 'Playing guard loading<br>';
|
|
|
+ }
|
|
|
+
|
|
|
+ public function fire($ovtsa)
|
|
|
+ {
|
|
|
+ $ovtsa->health = $ovtsa->health - self::POWER;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function selfCure()
|
|
|
+ {
|
|
|
+ $this->health = 40;
|
|
|
+ }
|
|
|
+}
|