public ActionEventArgs(Person doer, Person target, Prop prop, object data = null) { this.Doer = doer; this.Target = target; this.Prop = prop; this.Data = data; this.Stage = ActionStages.Passive; }
public Prop CreateProp(string name) { Prop newProp = new Prop(); newProp.Template = this.GetPropTemplate(name); newProp.Image = newProp.Template.Image; newProp.MaxOccupancy = newProp.Template.MaxOccupancy; return newProp; }
public Uri GetPropImage(Prop prop) { return new Uri(prop.Template.Source.Directory + @"\Props\Images\" + prop.Image); }
protected void PlaceProp(GameEntity target, Prop prop) { this.Agent.Inventory.Remove(prop); target.Inventory.Add(prop); }
protected GameAction UseProp(Prop prop) { GameAction action = null; if (prop != null && prop.Template.Actions.Count > 0) { action = GameAction.Get(MiscUtilities.GetRandomEntry<string>(prop.Template.Actions)); action.Perform(new ActionEventArgs(this.Agent, null, prop)); } return action; }