本文整理汇总了C#中Prop.SetState方法的典型用法代码示例。如果您正苦于以下问题:C# Prop.SetState方法的具体用法?C# Prop.SetState怎么用?C# Prop.SetState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prop
的用法示例。
在下文中一共展示了Prop.SetState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTouchGate
public void OnTouchGate(Creature creature, Prop gate)
{
if (gate.State != "closed")
return;
var canOpen = creature.Keywords.Has("g1_36") || creature.Titles.IsUsable(BreakerTitle);
var saturday = (ErinnTime.Now.Month == ErinnMonth.Samhain || IsEnabled("AllWeekBreaker"));
if (!canOpen)
{
Send.Notice(creature, Localization.Get("You are unable to open the gate."));
}
else if (!saturday)
{
Send.Notice(creature, Localization.Get("The gate can only be opened on Samhain."));
}
else
{
creature.Titles.Enable(BreakerTitle);
gate.SetState("open");
var portal = gate.Region.GetProp(a => a.Info.Id == GatePortalPropId);
portal.Extensions.Add(new ConfirmationPropExtension("portal(45360425219915779)", L("Would you like to go to the world across the Sealed door?")));
}
}
示例2: OnOrbHit
private void OnOrbHit(Creature creature, Prop prop)
{
if (prop.State == "off")
{
var hits = prop.Vars.Temp.Get("orbHit", 0) + 1;
prop.Vars.Temp["orbHit"] = hits;
if (hits == OrbHits)
{
Send.Notice(creature, L("You broke the seal and received the Black Orb Fragment!\nCollect all four to receive the Black Orb."));
prop.SetState("on");
new Item(FragmentId).Drop(prop.Region, prop.GetPosition(), 50);
}
}
}
示例3: OnCleared
public override void OnCleared(Dungeon dungeon)
{
var rnd = RandomProvider.Get();
var creators = dungeon.GetCreators();
var count = Math.Min(7, creators.Count);
for (int i = 0; i < count; ++i)
{
var member = creators[i];
var treasureChest = new TreasureChest();
treasureChest.AddGold(rnd.Next(320, 1280)); // Gold
treasureChest.Add(GetRandomTreasureItem(rnd)); // Random item
dungeon.AddChest(treasureChest);
member.GiveItemWithEffect(Item.CreateKey(70028, "chest"));
}
var orb = new Prop(25032, 0, 0, 0, 0);
orb.SetState("off");
orb.Behavior = OnOrbHit;
dungeon.AddChest(orb);
}
示例4: SetBreaker
private void SetBreaker(Prop prop, long entityId, string characterName)
{
prop.SetState("state3");
prop.Xml.SetAttributeValue("breaker_id", entityId);
prop.Xml.SetAttributeValue("breaker_name", characterName);
_hits = _required;
}