public Actor CreateActor(Player owner, Guid?externalId, string nativeName, RoleModelNative roleModel, Tile target, string visualization, string enemyVisualization, float?z) { if (target.TempObject != null) { return(null); } Actor actor = new Actor(this, owner, externalId, target, visualization, enemyVisualization, z, NativeManager.GetActorNative(nativeName), roleModel); Actors.Add(actor); target.ChangeTempObject(actor, true); return(actor); }
public Actor(ISceneParentRef parent, IPlayerParentRef owner, Guid?externalId, ITileParentRef tempTile, string visualization, string enemyVisualization, float?z, ActorNative native, RoleModelNative roleModelNative) : base(parent, owner, tempTile, z ?? native.DefaultZ, new DamageModel(), native) { this.varManager = parent.VarManager; this.Visualization = visualization ?? native.DefaultVisualization; this.EnemyVisualization = enemyVisualization ?? native.DefaultEnemyVisualization; this.ExternalId = externalId; this.native = native; this.SelfStrength = roleModelNative.DefaultStrength; this.SelfWillpower = roleModelNative.DefaultWillpower; this.SelfConstitution = roleModelNative.DefaultConstitution; this.SelfSpeed = roleModelNative.DefaultSpeed; this.SelfActionPointsIncome = roleModelNative.DefaultActionPointsIncome; this.DefaultArmor = native.Armor.ToArray(); this.Skills = new List <Skill>(); foreach (SkillNative skill in roleModelNative.Skills) { Skills.Add(new Skill(this, skill, null, null, null, null, null, null)); } this.AttackingSkill = new Skill(this, roleModelNative.AttackingSkill, null, null, 0, null, null, null); this.BuffManager = new BuffManager(this); this.InitiativePosition += 1f / this.Initiative; this.DamageModel.SetupRoleModel(this); }
public RoleModelNative GetRoleModelNative(string id) { RoleModelNative native = roleModelNatives[id]; return(native); }