本文整理汇总了C#中Poison类的典型用法代码示例。如果您正苦于以下问题:C# Poison类的具体用法?C# Poison怎么用?C# Poison使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Poison类属于命名空间,在下文中一共展示了Poison类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constructor_StoresValueType
public void Constructor_StoresValueType()
{
int value = 42;
var poison = new Poison<int>(value, new ArgumentNullException());
Assert.Equal(value, poison.Input);
}
示例2: Constructor_StoresException
public void Constructor_StoresException()
{
var exception = new ArgumentNullException("foo");
var poison = new Poison<int>(42, exception);
Assert.Equal(new ExceptionDetails(exception), poison.Exception, GenericEqualityComparer<ExceptionDetails>.ByAllMembers());
}
示例3: Constructor_StoresReferenceType
public void Constructor_StoresReferenceType()
{
string value = "test";
var poison = new Poison<string>(value, new ArgumentNullException());
Assert.Equal(value, poison.Input);
}
示例4: GetLowerPoison
/// <summary>
/// Lowers an applied poison level by one degree at <code>PerkLevel.Second</code>
/// </summary>
public Poison GetLowerPoison( Poison p )
{
if( Level < PerkLevel.Second )
return p;
return Poison.GetPoison(p.Level - 1);
}
示例5: Cast_Spell
public override void Cast_Spell(Summon s)
{
base.Cast_Spell(s);
if (Random.Range(0, 101) > 90)
{
results += new Poison().Do_Ability(s);
}
}
示例6: Start
void Start()
{
animator = GetComponent<Animator>();
poisonRef = GetComponentInParent<Poison>();
areaOfEffect = GetComponent<Collider2D>();
areaOfEffect.enabled = false;
}
示例7: Do_Ability
public SpellResults Do_Ability(Summon s)
{
int heal = s.Base_Health / 10 + s.Curse * 5;
SpellResults r = new SpellResults(0, 0, heal, 0, 0, 0);
//if (Random.Range(0, 101) > 80)
r += new Burn().Do_Ability(s);
//if (Random.Range(0, 101) > 80)
r += new Poison().Do_Ability(s);
return r;
}
示例8: AddNewFoodAndPoison
public void AddNewFoodAndPoison(int n)
{
for (int i = 0; i < n; i++)
{
Foods.Add(new Food());
Foods[i] = new Food();
}
for (int i = 0; i < n; i++)
{
Poisons.Add(new Poison());
Poisons[i] = new Poison();
}
}
示例9: NewFoodAndPoison
public void NewFoodAndPoison()
{
int PoisonVariable = BetterRandom.PoisonVariable(0.01);
for (int i = 0; i < PoisonVariable; i++)
{
Food tmp = new Food();
Foods.Add(new Food());
}
PoisonVariable = BetterRandom.PoisonVariable(0.015);
for (int i = 0; i < PoisonVariable; i++)
{
Poison tmp = new Poison();
Poisons.Add(new Poison());
}
}
示例10: Assassin
public Assassin()
{
heroTexture = Engine.Engine.GetTexture("Hero/Assassin");
Hero.loadSprite();
heroRole = Classes.Assassin;
baseHealth = 450;
healthPerLevel = 35;
requiredBranchLevel = int.MaxValue;
resetLevel();
resetHealth();
abilities[0] = new Mug();
abilities[1] = new Invisibility();
abilities[2] = new Parry();
abilities[3] = new Eviscerate();
abilities[4] = new Assassinate();
abilities[5] = new Poison();
Enemies.Enemy.UpdateTargets(this);
Enemies.BossEnemy.UpdateBossTargets(this);
}
示例11: Deserialize
//.........这里部分代码省略.........
{
m_DurabilityLevel = (WeaponDurabilityLevel)reader.ReadInt();
if (m_DurabilityLevel > WeaponDurabilityLevel.Indestructible)
{
m_DurabilityLevel = WeaponDurabilityLevel.Durable;
}
}
if (GetSaveFlag(flags, SaveFlag.Quality))
{
m_Quality = (WeaponQuality)reader.ReadInt();
}
else
{
m_Quality = WeaponQuality.Regular;
}
if (GetSaveFlag(flags, SaveFlag.Hits))
{
m_Hits = reader.ReadInt();
}
if (GetSaveFlag(flags, SaveFlag.MaxHits))
{
m_MaxHits = reader.ReadInt();
}
if (GetSaveFlag(flags, SaveFlag.Slayer))
{
m_Slayer = (SlayerName)reader.ReadInt();
}
if (GetSaveFlag(flags, SaveFlag.Poison))
{
m_Poison = Poison.Deserialize(reader);
}
if (GetSaveFlag(flags, SaveFlag.PoisonCharges))
{
m_PoisonCharges = reader.ReadInt();
}
if (GetSaveFlag(flags, SaveFlag.Crafter))
{
m_Crafter = reader.ReadMobile();
}
if (GetSaveFlag(flags, SaveFlag.Identified))
{
m_Identified = (version >= 6 || reader.ReadBool());
}
if (GetSaveFlag(flags, SaveFlag.StrReq))
{
m_StrReq = reader.ReadInt();
}
else
{
m_StrReq = -1;
}
if (GetSaveFlag(flags, SaveFlag.DexReq))
{
m_DexReq = reader.ReadInt();
}
示例12: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_Poison = Poison.Deserialize( reader );
break;
}
}
}
示例13: GasTrap
public GasTrap( GasTrapType type, Poison poison ) : base( GetBaseID( type ) )
{
m_Poison = poison;
}
示例14: CheckPoisonImmunity
public override bool CheckPoisonImmunity( Mobile from, Poison poison )
{
if ( base.CheckPoisonImmunity( from, poison ) )
return true;
Poison p = this.PoisonImmune;
return ( p != null && p.Level >= poison.Level );
}
示例15: ApplyPoison
public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false)
{
}