Режим змеи: ноль опыта за убийства змеёй
Префикс EntityPlayer.AddKillXP пропускает начисление опыта для жертв змеи. Некромантия и урон ножа растут как прежде: их счёт - постфикс на том же методе, Harmony вызывает его и при отменённом оригинале. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6ff76d174e
commit
e71f1aef35
@@ -95,6 +95,9 @@ namespace NecromancerTome
|
||||
/// <summary>Убитые змеёй: с них не падает мешок с добычей (указание 28.09: «в режиме змеи
|
||||
/// лут не выпадал вообще»). Снимается в патче dropItemOnDeath.</summary>
|
||||
public static readonly System.Collections.Generic.HashSet<int> NoLoot = new System.Collections.Generic.HashSet<int>();
|
||||
/// <summary>Убитые змеёй: опыт за них - ноль (указание 28.09: «форма не для повышения уровней
|
||||
/// или лута, она для повышения уровня Некромантии»). Снимается в патче AddKillXP.</summary>
|
||||
public static readonly System.Collections.Generic.HashSet<int> NoXp = new System.Collections.Generic.HashSet<int>();
|
||||
|
||||
/// <summary>Зомби, которые заметили змею (указание 28.09: «встречные зомби просто стоят,
|
||||
/// скучно - пусть начинают ходить, если змея рядом»): не дальше StirRange идут к ней, как на
|
||||
@@ -349,6 +352,7 @@ namespace NecromancerTome
|
||||
_freeze = KillFreeze;
|
||||
_killId = target.entityId;
|
||||
NoLoot.Add(target.entityId);
|
||||
NoXp.Add(target.entityId);
|
||||
NecroBurst.Pending.Add(target.entityId);
|
||||
target.DamageEntity(new DamageSourceEntity(EnumDamageSource.External, EnumDamageTypes.Piercing, _player.entityId),
|
||||
99999, false);
|
||||
@@ -356,6 +360,7 @@ namespace NecromancerTome
|
||||
{
|
||||
NecroBurst.Pending.Remove(target.entityId);
|
||||
NoLoot.Remove(target.entityId);
|
||||
NoXp.Remove(target.entityId);
|
||||
}
|
||||
Debug.Log("[NecromancerTome] SnakeControl: удар по " + target.EntityName + ", " + (target.IsDead() ? "убит" : "ВЫЖИЛ"));
|
||||
}
|
||||
@@ -1209,4 +1214,17 @@ namespace NecromancerTome
|
||||
public static void Prefix(out Vector3 __state) { __state = SnakeAudioSwap.Prefix(); }
|
||||
public static void Postfix(Vector3 __state) { SnakeAudioSwap.Postfix(__state); }
|
||||
}
|
||||
|
||||
/// <summary>Ноль опыта за убийство змеёй. EntityPlayer.AddKillXP - единственное место, где игра
|
||||
/// начисляет опыт за убийство; префикс пропускает его целиком. Некромантия НЕ теряется: её счёт -
|
||||
/// постфикс на том же методе (NecromancyKillCreditPatch), а Harmony вызывает постфиксы и тогда,
|
||||
/// когда префикс отменил оригинал. Рост урона ножа идёт от того же счётчика.</summary>
|
||||
[HarmonyPatch(typeof(EntityPlayer), "AddKillXP")]
|
||||
public static class Patch_EntityPlayer_AddKillXP_SnakeNoXp
|
||||
{
|
||||
public static bool Prefix(EntityAlive killedEntity)
|
||||
{
|
||||
return killedEntity == null || !SnakeControl.NoXp.Remove(killedEntity.entityId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user