当前位置: 首页>>代码示例>>C#>>正文


C# Prop.SetState方法代码示例

本文整理汇总了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?")));
		}
	}
开发者ID:aura-project,项目名称:aura,代码行数:26,代码来源:g1_30_bangor_barri_dungeon.cs

示例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);
			}
		}
	}
开发者ID:aura-project,项目名称:aura,代码行数:16,代码来源:g1_37_red_tirnanog_dungeon.cs

示例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);
	}
开发者ID:aura-project,项目名称:aura,代码行数:24,代码来源:g1_37_red_tirnanog_dungeon.cs

示例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;
	}
开发者ID:Rai,项目名称:aura,代码行数:7,代码来源:sealstones.cs


注:本文中的Prop.SetState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。