本文整理汇总了C#中Combat类的典型用法代码示例。如果您正苦于以下问题:C# Combat类的具体用法?C# Combat怎么用?C# Combat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Combat类属于命名空间,在下文中一共展示了Combat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override void Run(Combat.Character character)
{
Int32 spritepriority = EvaluationHelper.AsInt32(character, Priority, 0);
spritepriority = Misc.Clamp(spritepriority, -5, 5);
character.DrawOrder = spritepriority;
}
示例2: Run
public override void Run(Combat.Character character)
{
Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue);
Vector2 offset = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0));
foreach (Combat.Character target in character.GetTargets(target_id))
{
switch (BindPosition)
{
case BindToTargetPostion.Mid:
offset += target.BasePlayer.Constants.Midposition;
break;
case BindToTargetPostion.Head:
offset += target.BasePlayer.Constants.Headposition;
break;
case BindToTargetPostion.None:
case BindToTargetPostion.Foot:
default:
break;
}
character.Bind.Set(target, offset, time, 0, false);
break;
}
}
示例3: Run
public override void Run(Combat.Character character)
{
character.OffensiveInfo.MoveContact = 0;
character.OffensiveInfo.MoveGuarded = 0;
character.OffensiveInfo.MoveHit = 0;
character.OffensiveInfo.MoveReversed = 0;
}
示例4: Run
public override void Run(Combat.Character character)
{
Int32? start = EvaluationHelper.AsInt32(character, StartRange, null);
Int32? end = EvaluationHelper.AsInt32(character, EndRange, null);
if (IntNumber != null)
{
Int32? value = EvaluationHelper.AsInt32(character, IntNumber, null);
if (value != null)
{
for (Int32 i = 0; i != character.Variables.IntegerVariables.Count; ++i)
{
if (i < start || i > end) continue;
character.Variables.SetInteger(i, false, value.Value);
}
}
}
if (FloatNumber != null)
{
Single? value = EvaluationHelper.AsSingle(character, FloatNumber, null);
if (value != null)
{
for (Int32 i = 0; i != character.Variables.FloatVariables.Count; ++i)
{
if (i < start || i > end) continue;
character.Variables.SetFloat(i, false, value.Value);
}
}
}
}
示例5: Run
public override void Run(Combat.Character character)
{
Single x = EvaluationHelper.AsSingle(character, X, 0);
Single y = EvaluationHelper.AsSingle(character, Y, 0);
character.Move(new Vector2(x, y));
}
示例6: Draw
public override void Draw(Combat.PaletteFx palettefx)
{
Point tilestart;
Point tileend;
GetTileLength(Sprite.Size, out tilestart, out tileend);
Video.DrawState drawstate = SpriteManager.DrawState;
drawstate.Reset();
drawstate.Blending = Transparency;
drawstate.ScissorRectangle = DrawRect;
drawstate.Set(Sprite);
for (Int32 y = tilestart.Y; y != tileend.Y; ++y)
{
for (Int32 x = tilestart.X; x != tileend.X; ++x)
{
Vector2 adjustment = (Vector2)(Sprite.Size + TilingSpacing) * new Vector2(x, y);
Vector2 location = CurrentLocation + adjustment;
drawstate.AddData(location, null);
}
}
if (palettefx != null) palettefx.SetShader(drawstate.ShaderParameters);
drawstate.Use();
}
示例7: Questor
public Questor()
{
_lastPulse = DateTime.MinValue;
_random = new Random();
_salvage = new Salvage();
_defense = new Defense();
_combat = new Combat();
_traveler = new Traveler();
_unloadLoot = new UnloadLoot();
_agentInteraction = new AgentInteraction();
_arm = new Arm();
_missionController = new MissionController();
_drones = new Drones();
_panic = new Panic();
_storyline = new Storyline();
Settings.Instance.SettingsLoaded += SettingsLoaded;
// State fixed on ExecuteMission
State = QuestorState.Idle;
_directEve = new DirectEve();
Cache.Instance.DirectEve = _directEve;
_directEve.OnFrame += OnFrame;
}
示例8: Init
// Use this for initialization
public void Init()
{
player_combatData = GameObject.Find("player").GetComponent<Combat>();
health = playerHealth.GetComponent<Slider>();
mana = playerMana.GetComponent<Slider>();
init = true;
}
示例9: Trigger
public Boolean Trigger(Combat.Character character)
{
if (character == null) throw new ArgumentNullException("character");
foreach (var trigger in m_triggers)
{
Boolean ok = true;
foreach (Evaluation.Expression exp in trigger.Value)
{
if(exp.EvaluateFirst(character).BooleanValue == false)
{
ok = false;
break;
}
}
if (ok == true)
{
if (trigger.Key != 0) return true;
}
else
{
if (trigger.Key == 0) return false;
}
}
return false;
}
示例10: Run
public override void Run(Combat.Character character)
{
Single x = EvaluationHelper.AsSingle(character, X, 0);
Single y = EvaluationHelper.AsSingle(character, Y, 0);
character.CurrentVelocity += new Vector2(x, y);
}
示例11: Run
public override void Run(Combat.Character character)
{
Int32 explod_id = EvaluationHelper.AsInt32(character, Id, Int32.MinValue);
Int32 time = EvaluationHelper.AsInt32(character, Time, 1);
foreach (Combat.Explod explod in character.GetExplods(explod_id)) explod.Data.BindTime = time;
}
示例12: Storyline
public Storyline()
{
_combat = new Combat();
_traveler = new Traveler();
_agentInteraction = new AgentInteraction();
_agentBlacklist = new List<long>();
_storylines = new Dictionary<string, IStoryline>();
//_storylines.Add("__", new GenericCombatStoryline());
//_storylines.Add("Materials For War Preparation", new MaterialsForWarPreparation());
_storylines.Add("Shipyard Theft", new GenericCombatStoryline());
_storylines.Add("Evolution", new GenericCombatStoryline());
_storylines.Add("Record Cleaning", new GenericCombatStoryline());
_storylines.Add("Covering Your Tracks", new GenericCombatStoryline());
_storylines.Add("Crowd Control", new GenericCombatStoryline());
_storylines.Add("A Force to Be Reckoned With", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - Ambush In The Dark (1 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - The Kidnapping (3 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - Incriminating Evidence (5 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - The Secret Meeting (7 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - Defend the Civilian Convoy (8 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - Retrieve the Prisoners (9 of 10)", new GenericCombatStoryline());
_storylines.Add("Kidnappers Strike - The Final Battle (10 of 10)", new GenericCombatStoryline());
_storylines.Add("Whispers in the Dark - First Contact (1 of 4)", new GenericCombatStoryline());
_storylines.Add("Whispers in the Dark - Lay and Pray (2 of 4)", new GenericCombatStoryline());
_storylines.Add("Whispers in the Dark - The Outpost (4 of 4)", new GenericCombatStoryline());
_storylines.Add("Transaction Data Delivery", new TransactionDataDelivery());
_storylines.Add("Innocents in the Crossfire", new TransactionDataDelivery());
}
示例13: init
public override void init()
{
combatData = gameObject.GetComponent<Combat>();
movement = gameObject.GetComponent<Navigation>();
ai = GetComponent<HasObjectivePath>();
}
示例14: changeTarget
public void changeTarget()
{
if (player.target == null) return;
player_target.SetActive(true);
target = player.target.GetComponent<Combat>();
if(TeamLogic.areAllies(target.gameObject, player.gameObject))
{
targetHealth.color = new Color(0, 255, 0);
}
else
{
targetHealth.color = new Color(255, 0, 0);
}
/*
if(target.maxMana() > 0)
{
targetMana.color = new Color(0, 0, 255);
}
else
{
targetMana.color = new Color(255, 255, 255);
}
*/
}
示例15: GetRange
Boolean GetRange(Combat.Character character, out Int32 min, out Int32 max)
{
if (Range == null)
{
min = 0;
max = 1000;
return true;
}
Evaluation.Number[] result = Range.Evaluate(character);
if (result.Length > 0 && result[0].NumberType != NumberType.None)
{
if (result.Length > 1 && result[1].NumberType != NumberType.None)
{
min = result[0].IntValue;
max = result[1].IntValue;
return true;
}
else
{
min = 0;
max = result[0].IntValue;
return true;
}
}
min = 0;
max = 1;
return false;
}