Skip to content

Commit

Permalink
Убрал Свиток Исцеления. Добавил Свиток Разложения. Fixed #42.
Browse files Browse the repository at this point in the history
  • Loading branch information
devapromix committed Jan 31, 2023
1 parent f700f06 commit 4de3216
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
4 changes: 2 additions & 2 deletions client1/Lizardry.Effects.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
interface

const
EffectStr: array [0 .. 6] of string = ('Нет', 'Благословение',
EffectStr: array [0 .. 7] of string = ('Нет', 'Благословение',
'Регенерация здоровья', 'Кража жизни', 'Отражение урона', 'Разрушение',
'Иммунитет к яду');
'Иммунитет к яду', 'Разложение');

implementation

Expand Down
13 changes: 13 additions & 0 deletions server/includes/class.battle.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ private function enemy_battle_round() {
$r = '';

if (($user['enemy_life_cur'] > 0) && ($user['char_life_cur'] > 0)) {
if ($user['class']['effect']->has(Magic::PLAYER_EFFECT_DECAY) && (rand(1, 4) == 1))
$r .= enemy_effect_decay();
if (rand(1, $user['char_armor'] + 1) <= rand(1, $user['enemy_armor'])) {
if (rand(1, 100) > $user['skill_dodge']) {
if (rand(1, 100) > $user['skill_parry']) {
Expand Down Expand Up @@ -404,6 +406,17 @@ private function effect_poison() {
}
return $r;
}

private function enemy_effect_decay() {
global $user;
$r = '';
$hp = rand($this->get_current_region_value(), $user['char_region_level']) + 3;
if (($user['enemy_life_cur'] - $hp) > 0) {
$user['enemy_life_cur'] -= $hp;
$r .= $user['enemy_name'].' теряет '.$hp.' HP.#';
}
return $r;
}

}

Expand Down
10 changes: 5 additions & 5 deletions server/includes/class.item.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Item {
public const CAT_FOOD = 75;
public const CAT_TROPHY = 21;
public const CAT_SCROLL_TP = 25;
public const CAT_SCROLL_HEAL = 26;
public const CAT_SCROLL_DECAY = 26;
public const CAT_SCROLL_BLESS = 27;
public const CAT_ELIXIR_EMPTY = 28;
public const CAT_ING = 30;
Expand Down Expand Up @@ -241,8 +241,8 @@ public function use_item(int $item_ident) {
case self::CAT_SCROLL_TP:
$result = $user['class']['magic']->use_scroll_tp($item_ident);
break;
case self::CAT_SCROLL_HEAL:
$result = $user['class']['magic']->use_scroll_heal($item_ident);
case self::CAT_SCROLL_DECAY:
$result = $user['class']['magic']->use_scroll_decay($item_ident);
break;
case self::CAT_SCROLL_BLESS:
$result = $user['class']['magic']->use_scroll_bless($item_ident);
Expand Down Expand Up @@ -383,7 +383,7 @@ private function gen_else_loot() {
self::CAT_ELIXIR_TROLL,
self::CAT_ELIXIR_ANTIDOTE,
self::CAT_SCROLL_TP,
self::CAT_SCROLL_HEAL,
self::CAT_SCROLL_DECAY,
self::CAT_SCROLL_BLESS,
self::CAT_SCROLL_LEECH,
self::CAT_SCROLL_REFLECT,
Expand All @@ -409,7 +409,7 @@ public function gen_mage_loot() {
$this->gen_random_loot([
self::CAT_ELIXIR_MP,
self::CAT_SCROLL_TP,
self::CAT_SCROLL_HEAL,
self::CAT_SCROLL_DECAY,
self::CAT_SCROLL_BLESS,
self::CAT_SCROLL_LEECH,
self::CAT_SCROLL_REFLECT,
Expand Down
9 changes: 5 additions & 4 deletions server/includes/class.magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Magic {

public const MANA_SCROLL_BLESS = 5;
public const MANA_SCROLL_HEAL = 7;
public const MANA_SCROLL_DECAY = 7;
public const MANA_SCROLL_TP = 8;
public const MANA_SCROLL_LEECH = 9;
public const MANA_SCROLL_REFLECT = 10;
Expand All @@ -15,6 +15,7 @@ class Magic {
public const PLAYER_EFFECT_REFLECT = 4;
public const PLAYER_EFFECT_DESTRUCT = 5;
public const PLAYER_EFFECT_IMMUN = 6;
public const PLAYER_EFFECT_DECAY = 7;

public function __construct() {

Expand Down Expand Up @@ -88,10 +89,10 @@ public function use_scroll_destruct($item_ident) {
} else $this->need_mana($mana);
}

public function use_scroll_heal($item_ident) {
public function use_scroll_decay($item_ident) {
global $user;
$mana = self::MANA_SCROLL_HEAL;
$effect_ident = self::PLAYER_EFFECT_REGEN;
$mana = self::MANA_SCROLL_DECAY;
$effect_ident = self::PLAYER_EFFECT_DECAY;
if ($user['char_mana_cur'] >= $mana) {
$user['class']['item']->modify($item_ident, -1);
$user['char_mana_cur'] -= $mana;
Expand Down

0 comments on commit 4de3216

Please sign in to comment.