本文整理汇总了C#中Classes.Player.HasAffect方法的典型用法代码示例。如果您正苦于以下问题:C# Player.HasAffect方法的具体用法?C# Player.HasAffect怎么用?C# Player.HasAffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Classes.Player
的用法示例。
在下文中一共展示了Player.HasAffect方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcStatBonuses
//.........这里部分代码省略.........
{
classLvl = gbl.max_class_hit_dice[(int)classId];
}
if (classLvl > player.multiclassLevel)
{
classLvl -= player.multiclassLevel;
hitPointBonus += ConHitPointBonus(classLvl, classId, stat_a, player);
}
}
hitPointBonus /= classCount;
player.hit_point_max += (byte)hitPointBonus;
if (player.hit_point_max > orig_max_hp)
{
player.hit_point_current += (byte)(player.hit_point_max - orig_max_hp);
}
else if (player.hit_point_max < orig_max_hp)
{
if (player.hit_point_current > (orig_max_hp - player.hit_point_max))
{
player.hit_point_current -= (byte)(orig_max_hp - player.hit_point_max);
}
else
{
player.hit_point_current = 0;
}
}
player.stats2.Con.full = stat_a;
if (player.stats2.Con.full > 20)
{
if (player.HasAffect(Affects.highConRegen) == true)
{
add_affect(false, 0xff, 0x3c, Affects.highConRegen, player);
}
}
else
{
remove_affect(null, Affects.highConRegen, player);
}
}
else if (stat_index == Stat.INT)
{
if (player.HasAffect(Affects.feeblemind) == true && var_11 > 7)
{
var_11 = 3;
}
if (var_11 != 0xff)
{
player.stats2.Int.full = var_11;
}
else
{
player.stats2.Int.full = stat_a;
}
}
else if (stat_index == Stat.WIS)
{
if (player.HasAffect(Affects.feeblemind) == true &&
var_11 > 7)
{
var_11 = 3;
}
if (var_11 != 0xff)
{
player.stats2.Wis.full = var_11;
}
else
{
player.stats2.Wis.full = stat_a;
}
}
else if (stat_index == Stat.DEX)
{
if (var_11 != 0xff)
{
player.stats2.Dex.full = var_11;
}
else
{
player.stats2.Dex.full = stat_a;
}
}
else if (stat_index == Stat.CHA)
{
Affect affect;
if (ovr025.FindAffect(out affect, Affects.friends, player) == true)
{
stat_a = affect.affect_data;
}
player.stats2.Cha.full = stat_a;
}
}
示例2: in_poison_cloud
internal static void in_poison_cloud(byte arg_0, Player player)
{
if (player.in_combat == true)
{
bool isPoisonousCloud;
bool isNoxiouxCloud;
int dummyGroundTile;
int dummyPlayerIndex;
ovr033.getGroundInformation(out isPoisonousCloud, out isNoxiouxCloud, out dummyGroundTile, out dummyPlayerIndex, 8, player);
Affect affect;
if (isNoxiouxCloud && arg_0 != 0 &&
ovr025.FindAffect(out affect, Affects.helpless, player) == false &&
ovr025.FindAffect(out affect, Affects.animate_dead, player) == false &&
ovr025.FindAffect(out affect, Affects.affect_6f, player) == false &&
ovr025.FindAffect(out affect, Affects.affect_7d, player) == false)
{
bool save_passed = RollSavingThrow(0, 0, player);
if (save_passed == true)
{
Player tmp_player_ptr = gbl.SelectedPlayer;
gbl.SelectedPlayer = sub_63D03(gbl.unk_18AEA, 4, gbl.NoxiousCloud, ovr033.PlayerMapPos(player));
is_unaffected("starts to cough", save_passed, 0, false, 0xff, 1, Affects.stinking_cloud, player);
if (player.HasAffect(Affects.stinking_cloud) == true)
{
ovr013.CallAffectTable(Effect.Add, affect, player, Affects.stinking_cloud);
}
gbl.SelectedPlayer = tmp_player_ptr;
}
else
{
Player tmp_player_ptr = gbl.SelectedPlayer;
gbl.SelectedPlayer = sub_63D03(gbl.unk_18AEA, 4, gbl.NoxiousCloud, ovr033.PlayerMapPos(player));
is_unaffected("chokes and gags from nausea", save_passed, 0, false, 0xff, (ushort)(roll_dice(4, 1) + 1), Affects.helpless, player);
if (ovr025.FindAffect(out affect, Affects.helpless, player) == true)
{
ovr013.CallAffectTable(Effect.Add, affect, player, Affects.helpless);
}
gbl.SelectedPlayer = tmp_player_ptr;
}
}
if (isPoisonousCloud == true &&
player.in_combat == true)
{
if (player.HitDice >= 0 && player.HitDice <= 4)
{
ovr025.DisplayPlayerStatusString(false, 10, "is Poisoned", player);
seg041.GameDelay();
add_affect(false, 0xff, 0, Affects.minor_globe_of_invulnerability, player);
KillPlayer("is killed", Status.dead, player);
}
else if (player.HitDice == 5)
{
if (RollSavingThrow(-4, 0, player) == false)
{
ovr025.DisplayPlayerStatusString(false, 10, "is Poisoned", player);
seg041.GameDelay();
add_affect(false, 0xff, 0, Affects.poisoned, player);
KillPlayer("is killed", Status.dead, player);
}
}
else if (player.HitDice == 6)
{
if (RollSavingThrow(0, 0, player) == false)
{
ovr025.DisplayPlayerStatusString(false, 10, "is Poisoned", player);
seg041.GameDelay();
add_affect(false, 0xff, 0, Affects.poisoned, player);
KillPlayer("is killed", Status.dead, player);
}
}
}
}
}
示例3: AffectParalizingGaze
/* spell_stone */
internal static void AffectParalizingGaze(Effect arg_0, object param, Player player)
{
player.actions.target = null;
gbl.byte_1DA70 = gbl.SpellCastFunction(QuickFight.True, (int)Spells.spell_41);
if (player.actions.target != null)
{
gbl.spell_target = player.actions.target;
ovr025.DisplayPlayerStatusString(false, 10, "gazes...", player);
ovr025.load_missile_icons(0x12);
ovr025.draw_missile_attack(0x2d, 4, ovr033.PlayerMapPos(gbl.spell_target), ovr033.PlayerMapPos(player));
if (player.HasAffect(Affects.affect_7f) == true)
{
Item item = gbl.spell_target.items.Find(i => i.readied && (i.namenum1 == 0x76 || i.namenum2 == 0x76 || i.namenum3 == 0x76));
if (item != null)
{
ovr025.DisplayPlayerStatusString(false, 12, "reflects it!", gbl.spell_target);
ovr025.draw_missile_attack(0x2d, 4, ovr033.PlayerMapPos(player), ovr033.PlayerMapPos(gbl.spell_target));
gbl.spell_target = player;
}
}
if (ovr024.RollSavingThrow(0, SaveVerseType.type1, gbl.spell_target) == false)
{
ovr024.KillPlayer("is Stoned", Status.stoned, gbl.spell_target);
}
}
}
示例4: RemoveCombatAffects
// sub_645AB
internal static void RemoveCombatAffects(Player player)
{
Affects[] table = {
Affects.faerie_fire,
Affects.charm_person,
Affects.reduce,
Affects.silence_15_radius,
Affects.spiritual_hammer,
Affects.stinking_cloud,
Affects.helpless,
Affects.animate_dead,
Affects.snake_charm,
Affects.paralyze,
Affects.sleep,
Affects.clear_movement,
Affects.regenerate,
Affects.affect_5F,
Affects.regen_3_hp,
Affects.entangle,
Affects.affect_89,
Affects.affect_8b,
Affects.owlbear_hug_round_attack
};
System.Array.ForEach(table, affect => remove_affect(null, affect, player));
if (player.HasAffect(Affects.berserk) == true && player.control_morale == Control.PC_Berzerk)
{
player.combat_team = CombatTeam.Ours;
}
}
示例5: CanCastHeal
/* sub_575F0 */
internal static bool CanCastHeal(Player player)
{
return (player.SkillLevel(SkillType.Paladin) > 0 &&
gbl.game_state != GameState.Combat &&
player.health_status == Status.okey &&
player.HasAffect(Affects.paladinDailyHealCast) == false);
}
示例6: PaladinCureDisease
/* sub_577EC */
internal static void PaladinCureDisease(Player player)
{
ovr025.LoadPic();
Player target = gbl.TeamList[0];
ovr025.selectAPlayer(ref target, true, "Cure whom? ");
if (target == null)
{
playerDisplayFull(gbl.SelectedPlayer);
}
else
{
bool is_diseased = System.Array.Exists(paladinCureableDiseases, affect => target.HasAffect(affect));
char input = 'Y';
if (is_diseased == false)
{
ovr025.DisplayPlayerStatusString(false, 0, "is not diseased", target);
input = ovr027.yes_no(gbl.defaultMenuColors, "cure anyway: ");
ovr025.ClearPlayerTextArea();
}
if (input == 'Y')
{
gbl.cureSpell = true;
System.Array.ForEach(paladinCureableDiseases, affect => ovr024.remove_affect(null, affect, target));
gbl.cureSpell = false;
if (player.paladinCuresLeft > 0)
{
player.paladinCuresLeft--;
}
if (player.HasAffect(Affects.paladinDailyCureRefresh) == false)
{
ovr024.add_affect(true, 0, 0x2760, Affects.paladinDailyCureRefresh, player);
}
ovr025.string_print01(target.name + " is cured");
}
playerDisplayFull(gbl.SelectedPlayer);
}
}
示例7: CanMove
{2, 2, 0, 4, 4, 4} /*, {4, 2, 6, 6}*/ }; /* actual from seg600:02BD - seg600:02F8 */
#endregion Fields
#region Methods
// sub_3573B
internal static bool CanMove(out bool groundClear, int baseDirecction, int dirStep, Player player)
{
groundClear = false;
bool canMove = false;
int var_6 = data_2B8[player.actions.field_15, dirStep - 1];
int playerDirection = (baseDirecction + var_6) % 8;
int groundTile;
int playerIndex;
bool isPoisonousCloud;
bool isNoxiousCloud;
ovr033.getGroundInformation(out isPoisonousCloud, out isNoxiousCloud, out groundTile, out playerIndex, playerDirection, player);
if (groundTile == 0)
{
groundClear = true;
}
else
{
if (gbl.BackGroundTiles[groundTile].move_cost == 0xff)
{
return false;
}
int move_cost = gbl.BackGroundTiles[groundTile].move_cost;
if ((playerDirection & 1) != 0)
{
move_cost *= 3;
}
else
{
move_cost *= 2;
}
if (playerIndex == 0 && move_cost < player.actions.move)
{
if (isNoxiousCloud == true &&
player.HasAffect(Affects.animate_dead) == false &&
player.HasAffect(Affects.stinking_cloud) == false &&
player.HasAffect(Affects.affect_6f) == false &&
player.HasAffect(Affects.affect_7d) == false &&
player.HasAffect(Affects.protect_magic) == false &&
player.HasAffect(Affects.minor_globe_of_invulnerability) == false &&
player.actions.fleeing == false)
{
if (ovr024.RollSavingThrow(0, 0, player) == false)
{
move_cost = player.actions.move + 1;
}
}
if (isPoisonousCloud == true &&
player.HitDice < 7 &&
player.HasAffect(Affects.protect_magic) == false &&
player.HasAffect(Affects.affect_6f) == false &&
player.HasAffect(Affects.affect_85) == false &&
player.HasAffect(Affects.affect_7d) == false &&
player.actions.fleeing == false)
{
move_cost = player.actions.move + 1;
}
if (player.actions.move >= move_cost)
{
canMove = true;
}
}
}
return canMove;
}
示例8: AffectTrollRegenerate
// sp_regenerate
internal static void AffectTrollRegenerate(Effect arg_0, object param, Player player)
{
if (player.HasAffect(Affects.regen_3_hp) == false &&
player.HasAffect(Affects.regenerate) == false)
{
ovr024.add_affect(true, 0xff, 3, Affects.regenerate, player);
}
}
示例9: AffectSlowPoison
// sub_3A517
internal static void AffectSlowPoison(Effect arg_0, object param, Player player)
{
if (player.HasAffect(Affects.poisoned) == true)
{
ovr024.KillPlayer("dies from poison", Status.dead, player);
}
gbl.cureSpell = true;
ovr024.remove_affect(null, Affects.poison_damage, player);
gbl.cureSpell = false;
}
示例10: weaken
internal static void weaken(Effect arg_0, object param, Player player)
{
Affect affect = (Affect)param;
if (addAffect(0x3c, affect.affect_data, Affects.weaken, player) == true)
{
if (player.stats2.Str.full > 3)
{
ovr025.DisplayPlayerStatusString(true, 10, "is weakened", player);
player.stats2.Str.full--;
}
else if (player.HasAffect(Affects.helpless) == true)
{
ovr024.add_affect(false, 0xff, 0, Affects.helpless, player);
}
}
}
示例11: sub_3B0C2
internal static void sub_3B0C2(Effect arg_0, object param, Player player)
{
Affect affect = (Affect)param;
if (addAffect(10, affect.affect_data, Affects.cause_disease_2, player) == true)
{
if (player.hit_point_current > 1)
{
gbl.damage_flags = 0;
ovr024.damage_person(false, 0, 1, player);
if (gbl.game_state != GameState.Combat)
{
ovr025.PartySummary(gbl.SelectedPlayer);
}
}
else if (player.HasAffect(Affects.helpless) == false)
{
ovr024.add_affect(false, 0xff, 0, Affects.helpless, player);
}
}
}