本文整理汇总了C#中Mooege.Core.GS.Map.World类的典型用法代码示例。如果您正苦于以下问题:C# World类的具体用法?C# World怎么用?C# World使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
World类属于Mooege.Core.GS.Map命名空间,在下文中一共展示了World类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateGizmo
private static Actor CreateGizmo(World world, int snoId, TagMap tags)
{
if (tags.ContainsKey(MarkerKeys.DestinationWorld))
return new Portal(world, snoId, tags);
return new Gizmo(world, snoId, tags);
}
示例2: Living
public Living(World world, int snoId, Dictionary<int, TagMapEntry> tags)
: base(world, snoId, tags)
{
this.SNOId = snoId;
var actor = (Mooege.Common.MPQ.FileFormats.Actor)Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.Actor][snoId].Data;
this.snoMonster = actor.MonsterSNO;
if (actor.AnimSetSNO != -1)
{
this.Animset = (Mooege.Common.MPQ.FileFormats.AnimSet)Mooege.Common.MPQ.MPQStorage.Data.Assets[Common.Types.SNO.SNOGroup.AnimSet][actor.AnimSetSNO].Data;
}
// FIXME: This is hardcoded crap
this.Field3 = 0x0;
this.RotationAmount = (float)(RandomHelper.NextDouble() * 2.0f * Math.PI);
this.RotationAxis.X = 0f; this.RotationAxis.Y = 0f; this.RotationAxis.Z = 1f;
this.GBHandle.Type = -1; this.GBHandle.GBID = -1;
this.Field7 = 0x00000001;
this.Field8 = this.SNOId;
this.Field10 = 0x0;
this.Field11 = 0x0;
this.Field12 = 0x0;
this.Field13 = 0x0;
//this.AnimationSNO = 0x11150;
this.CollFlags = 1;
this.Attributes[GameAttribute.Hitpoints_Max_Total] = 4.546875f;
this.Attributes[GameAttribute.Hitpoints_Max] = 4.546875f;
this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 0f;
this.Attributes[GameAttribute.Hitpoints_Cur] = 4.546875f;
// !!!! This line below caused Hirelings to crash! WTF? /fasbat
//this.Attributes[GameAttribute.Level] = 1;
}
示例3: SpellRune
public SpellRune(World world, Mooege.Common.MPQ.FileFormats.ItemTable definition)
: base(world, definition)
{
if (!definition.Name.Contains("X"))
{
// attuned rune, randomize power
int classRnd = RandomHelper.Next(0, 5);
int PowerSNOId = -1;
switch (classRnd)
{
case 0:
PowerSNOId = Skills.Skills.Barbarian.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Barbarian.AllActiveSkillsList.Count));
break;
case 1:
PowerSNOId = Skills.Skills.DemonHunter.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.DemonHunter.AllActiveSkillsList.Count));
break;
case 2:
PowerSNOId = Skills.Skills.Monk.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Monk.AllActiveSkillsList.Count));
break;
case 3:
PowerSNOId = Skills.Skills.WitchDoctor.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.WitchDoctor.AllActiveSkillsList.Count));
break;
case 4:
PowerSNOId = Skills.Skills.Wizard.AllActiveSkillsList.ElementAt(RandomHelper.Next(0, Mooege.Core.GS.Skills.Skills.Wizard.AllActiveSkillsList.Count));
break;
}
//this.Attributes[GameAttribute.Rune_Attuned_Power] = PowerSNOId;
}
}
示例4: Hireling
public Hireling(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
//this.Attributes[GameAttribute.TeamID] = 2;
Interactions.Add(new HireInteraction());
Interactions.Add(new InventoryInteraction());
}
示例5: Artisan
public Artisan(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
this.Attributes[GameAttribute.MinimapActive] = true;
Interactions.Add(new CraftInteraction());
}
示例6: Create
public static Actor Create(World world, int snoId, TagMap tagMap)
{
if (!MPQStorage.Data.Assets[SNOGroup.Actor].ContainsKey(snoId))
return null;
var actorAsset = MPQStorage.Data.Assets[SNOGroup.Actor][snoId];
var actorData = actorAsset.Data as Mooege.Common.MPQ.FileFormats.Actor;
if (actorData == null) return null;
if (actorData.Type == ActorType.Invalid)
return null;
// read tagMapEntries and put them into a dictionary
var tags = tagMap.TagMapEntries.ToDictionary(entry => entry.TagID);
// see if we have an implementation for actor.
if (SNOHandlers.ContainsKey(snoId))
return (Actor) Activator.CreateInstance(SNOHandlers[snoId], new object[] {world, snoId, tags});
switch (actorData.Type)
{
case ActorType.Monster:
if(tags.ContainsKey((int)MarkerTagTypes.ConversationList))
return new InteractiveNPC(world, snoId, tags);
else
return new Monster(world, snoId, tags);
case ActorType.Gizmo:
return CreateGizmo(world, snoId, tags);
}
return null;
}
示例7: ServerProp
public ServerProp(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
this.Field2 = 16;
this.Field7 = 0x00000001;
this.CollFlags = 0; // a hack for passing through blockers /fasbat
}
示例8: GetNearestTarget
// get nearest target of targetType
public static Actor GetNearestTarget(World world, Actor attacker, Vector3D centerPosition, float range, ActorType targetType = ActorType.Monster)
{
Actor result = null;
List<Actor> actors = world.QuadTree.Query<Actor>(new Circle(centerPosition.X, centerPosition.Y, range));
if (actors.Count > 1)
{
float distanceNearest = range; // max. range
float distance = 0f;
foreach (var target in actors.Where(target => ((target.ActorType == targetType) && (target != attacker) && !target.Attributes[GameAttribute.Is_NPC])))
{
if ((target.World == null) || (world.GetActorByDynamicId(target.DynamicID) == null))
{
// leaving world
continue;
}
distance = ActorUtils.GetDistance(centerPosition, target.Position);
if ((result == null) || (distance < distanceNearest))
{
result = target;
distanceNearest = distance;
}
}
}
return result;
}
示例9: InteractiveNPC
public InteractiveNPC(World world, int actorSNO, Vector3D position)
: base(world, actorSNO, position)
{
this.Attributes[GameAttribute.NPC_Has_Interact_Options, 0] = true;
this.Attributes[GameAttribute.NPC_Is_Operatable] = true;
this.Attributes[GameAttribute.Buff_Visual_Effect, 0x00FFFFF] = true;
}
示例10: Minion
public Minion(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
// The following two seems to be shared with monsters. One wonders why there isn't a specific actortype for minions.
this.Field2 = 0x8;
this.GBHandle.Type = (int)GBHandleType.Monster; this.GBHandle.GBID = 1;
}
示例11: TreasurePygmy
public TreasurePygmy(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
(Brain as MonsterBrain).AddPresetPower(105371);
(Brain as MonsterBrain).AddPresetPower(54836);
(Brain as MonsterBrain).AddPresetPower(105665);
}
示例12: Portal
public Portal(World world, int actorSNO, Vector3D position, Dictionary<int, TagMapEntry> tags)
: base(world, world.NewActorID, position, tags)
{
this.SNOId = actorSNO;
this.Destination = new ResolvedPortalDestination
{
WorldSNO = tags[(int)MarkerTagTypes.DestinationWorld].Int2,
};
if (tags.ContainsKey((int)MarkerTagTypes.DestinationLevelArea))
this.Destination.DestLevelAreaSNO = tags[(int)MarkerTagTypes.DestinationLevelArea].Int2;
if (tags.ContainsKey((int)MarkerTagTypes.DestinationActorTag))
this.Destination.StartingPointActorTag = tags[(int)MarkerTagTypes.DestinationActorTag].Int2;
else
Logger.Warn("Found portal {0}without target location actor", this.SNOId);
this.Field8 = this.SNOId;
this.Field2 = 16;
this.Field3 = 0;
this.CollFlags = 0x00000001;
// FIXME: Hardcoded crap; probably don't need to set most of these. /komiga
this.Attributes[GameAttribute.MinimapActive] = true;
this.Attributes[GameAttribute.Hitpoints_Max_Total] = 1f;
this.Attributes[GameAttribute.Hitpoints_Max] = 0.0009994507f;
this.Attributes[GameAttribute.Hitpoints_Total_From_Level] = 3.051758E-05f;
this.Attributes[GameAttribute.Hitpoints_Cur] = 0.0009994507f;
this.Attributes[GameAttribute.TeamID] = 1;
this.Attributes[GameAttribute.Level] = 1;
}
示例13: NPC
public NPC(World world, int snoId, TagMap tags)
: base(world, snoId, tags)
{
this.Field2 = 0x9;
this.Field7 = 2;
this.Attributes[GameAttribute.Is_NPC] = true;
}
示例14: Vendor
public Vendor(World world, int snoId, Dictionary<int, TagMapEntry> tags)
: base(world, snoId, tags)
{
this.Attributes[GameAttribute.MinimapActive] = true;
_vendorGrid = new InventoryGrid(this, 1, 20, (int) EquipmentSlotId.Vendor);
PopulateItems();
}
示例15: CreateGizmo
private static Actor CreateGizmo(World world, int snoId, Dictionary<int,TagMapEntry> tags)
{
if (tags.ContainsKey((int)MarkerTagTypes.DestinationWorld))
return new Portal(world, snoId, tags);
return new Gizmo(world, snoId, tags);
}