本文整理汇总了C#中Poison类的典型用法代码示例。如果您正苦于以下问题:C# Poison类的具体用法?C# Poison怎么用?C# Poison使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Poison类属于命名空间,在下文中一共展示了Poison类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Constructor_StoresValueType
public void Constructor_StoresValueType()
{
int value = 42;
var poison = new Poison<int>(value, new ArgumentNullException());
Assert.Equal(value, poison.Input);
}
开发者ID:netngn,项目名称:Burden,代码行数:7,代码来源:PoisonTest.cs
示例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());
}
开发者ID:netngn,项目名称:Burden,代码行数:7,代码来源:PoisonTest.cs
示例3: Constructor_StoresReferenceType
public void Constructor_StoresReferenceType()
{
string value = "test";
var poison = new Poison<string>(value, new ArgumentNullException());
Assert.Equal(value, poison.Input);
}
开发者ID:netngn,项目名称:Burden,代码行数:7,代码来源:PoisonTest.cs
示例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);
}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:10,代码来源:Adventurer.cs
示例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);
}
}
开发者ID:Higure27,项目名称:Grimoire,代码行数:8,代码来源:PoisonShield.cs
示例6: Start
void Start()
{
animator = GetComponent<Animator>();
poisonRef = GetComponentInParent<Poison>();
areaOfEffect = GetComponent<Collider2D>();
areaOfEffect.enabled = false;
}
开发者ID:khinbaptista,项目名称:GameJam2015,代码行数:8,代码来源:SpecialAttack.cs
示例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;
}
开发者ID:Higure27,项目名称:Grimoire,代码行数:10,代码来源:CurseFinisher.cs
示例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();
}
}
开发者ID:aidded,项目名称:ClassLibary5194,代码行数:13,代码来源:PhysicalLevel.cs
示例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());
}
}
开发者ID:aidded,项目名称:ClassLibary5194,代码行数:16,代码来源:PhysicalLevel.cs
示例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);
}
开发者ID:JonECG,项目名称:Brogue,代码行数:19,代码来源:Assassin.cs
示例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();
}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:67,代码来源:BaseWeapon.cs
示例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;
}
}
}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:15,代码来源:GasTrap.cs
示例13: GasTrap
public GasTrap( GasTrapType type, Poison poison ) : base( GetBaseID( type ) )
{
m_Poison = poison;
}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:4,代码来源:GasTrap.cs
示例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 );
}
开发者ID:greeduomacro,项目名称:uotitan,代码行数:9,代码来源:BaseCreature.cs
示例15: ApplyPoison
public override void ApplyPoison(Poison p, MapObject Caster = null, bool NoResist = false)
{
}
开发者ID:ufaith,项目名称:cmirosg,代码行数:3,代码来源:Tree.cs
示例16: ApplyPoison
public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
{
if( !Alive || IsDeadPet )
return ApplyPoisonResult.Immune;
ApplyPoisonResult result = base.ApplyPoison(from, poison);
if( from != null && result == ApplyPoisonResult.Poisoned && PoisonTimer is PoisonImpl.PoisonTimer )
(PoisonTimer as PoisonImpl.PoisonTimer).From = from;
return result;
}
开发者ID:ITLongwell,项目名称:Ulmeta,代码行数:12,代码来源:BaseCreature.cs
示例17: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch( version )
{
case 11:
case 10:
case 9:
case 8:
{
if( version <= 9 )
{
reader.ReadMobile();
reader.ReadString();
reader.ReadMobile();
}
goto case 7;
}
case 7:
case 6:
case 5:
{
SaveFlag flags = (SaveFlag)reader.ReadInt();
if( GetSaveFlag(flags, SaveFlag.DamageLevel) )
{
m_DamageLevel = (WeaponDamageLevel)reader.ReadInt();
if( m_DamageLevel > WeaponDamageLevel.Vanq )
m_DamageLevel = WeaponDamageLevel.Ruin;
}
if( GetSaveFlag(flags, SaveFlag.AccuracyLevel) )
{
m_AccuracyLevel = (WeaponAccuracyLevel)reader.ReadInt();
if( m_AccuracyLevel > WeaponAccuracyLevel.Supremely )
m_AccuracyLevel = WeaponAccuracyLevel.Accurate;
}
if( GetSaveFlag(flags, SaveFlag.DurabilityLevel) )
{
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) )
{
if( version <= 10 )
m_Identified = true;
else
m_Identified = reader.ReadBool();
}
if( GetSaveFlag(flags, SaveFlag.StrReq) )
m_StrReq = reader.ReadInt();
else
m_StrReq = -1;
if( GetSaveFlag(flags, SaveFlag.DexReq) )
m_DexReq = reader.ReadInt();
else
m_DexReq = -1;
if( GetSaveFlag(flags, SaveFlag.IntReq) )
m_IntReq = reader.ReadInt();
else
m_IntReq = -1;
if( GetSaveFlag(flags, SaveFlag.MinDamage) )
m_MinDamage = reader.ReadInt();
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:hubroot,代码行数:101,代码来源:BaseWeapon.cs
示例18: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
this.m_UsesRemaining = reader.ReadInt();
this.m_Poison = Poison.Deserialize(reader);
this.m_PoisonCharges = reader.ReadInt();
break;
}
}
}
开发者ID:FreeReign,项目名称:forkuo,代码行数:19,代码来源:Fukiya.cs
示例19: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 2:
{
SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
if ( GetSaveFlag( flags, SaveFlag.Crafter ) )
m_Crafter = reader.ReadMobile();
if ( GetSaveFlag( flags, SaveFlag.Quality ) )
m_Quality = (WineQuality)reader.ReadEncodedInt();
else
m_Quality = WineQuality.Regular;
if ( m_Quality == WineQuality.Low )
m_Quality = WineQuality.Regular;
if ( GetSaveFlag( flags, SaveFlag.Variety ) )
m_Variety = (GrapeVariety)reader.ReadEncodedInt();
else
m_Variety = DefaultVariety;
if ( m_Variety == GrapeVariety.None )
m_Variety = DefaultVariety;
//break;
goto case 1;
}
case 1:
{
m_Poisoner = reader.ReadMobile();
goto case 0;
}
case 0:
{
m_Poison = Poison.Deserialize( reader );
m_FillFactor = reader.ReadInt();
/*
m_Crafter = reader.ReadMobile();
m_Quality = (WineQuality)reader.ReadInt();
if ( version >= 2 )
{
m_Variety = (GrapeVariety)reader.ReadInt();
}
else
{
WineGrapeInfo info;
switch ( reader.ReadInt() )
{
default:
case 0: info = WineGrapeInfo.CabernetSauvignon; break;
case 1: info = WineGrapeInfo.Chardonnay; break;
case 2: info = WineGrapeInfo.CheninBlanc; break;
case 3: info = WineGrapeInfo.Merlot; break;
case 4: info = WineGrapeInfo.PinotNoir; break;
case 5: info = WineGrapeInfo.Riesling; break;
case 6: info = WineGrapeInfo.Sangiovese; break;
case 7: info = WineGrapeInfo.SauvignonBlanc; break;
case 8: info = WineGrapeInfo.Shiraz; break;
case 9: info = WineGrapeInfo.Viognier; break;
case 10: info = WineGrapeInfo.Zinfandel; break;
}
m_Variety = WinemakingResources.GetFromWineGrapeInfo( info );
}
*/
break;
}
}
}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:78,代码来源:BaseCraftWine.cs
示例20: ApplyPoison
public override ApplyPoisonResult ApplyPoison( Mobile from, Poison poison )
{
if ( !Alive || IsDeadPet )
return ApplyPoisonResult.Immune;
if ( Spells.Necromancy.EvilOmenSpell.CheckEffect( this ) )
return base.ApplyPoison( from, PoisonImpl.IncreaseLevel( poison ) );
return base.ApplyPoison( from, poison );
}
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:10,代码来源:BaseCreature.cs
注:本文中的Poison类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论