public Actor(ActorProperties properties, Team team) : base(properties.SpriteName) { this.ID = IdCounter++; this.Team = team; this.Properties = properties; }
public Actor(ActorProperties properties, Team team) : base(properties.SpriteName) { this.ID = IdCounter++; this.Team = team; this.Properties = properties; }
void Start() { PlayProps = GetComponent <PlayerProperties>(); ActorProps = GetComponent <ActorProperties>(); PlayConsts = WorldConstants.ConstantsOwner.GetComponent <PlayerConstants>(); ActorConsts = WorldConstants.ConstantsOwner.GetComponent <ActorConstants>(); }
private ActorProperties MakeSoldier(ActorProperties actorProps) { // so we can't call functions from within the CharacterData static classes... hmm. actorProps.Abilities.Add(new BasicMoveAbility()); actorProps.Abilities.Add(new WaitAbility()); actorProps.Inventory.AddItem(Weapons.AssaultRifle); actorProps.Inventory.EquipItem(Weapons.AssaultRifle); return actorProps; }
public void AddActor(ActorProperties actorProperties, Vector2i location) { var actor = new Actor(actorProperties); actor.x = this.tileSize * location.X + this.halfTileSize; actor.y = this.tileSize * location.Y + this.halfTileSize; actor.width = actor.height = this.tileSize; this.actorToPoint.Add(actor, location); this.pointToActor.Add(location, actor); }
private ActorProperties MakeSoldier(ActorProperties actorProps) { // so we can't call functions from within the CharacterData static classes... hmm. actorProps.Abilities.Add(new BasicMoveAbility()); actorProps.Abilities.Add(new WaitAbility()); actorProps.Inventory.AddItem(Weapons.AssaultRifle); actorProps.Inventory.EquipItem(Weapons.AssaultRifle); return(actorProps); }
// Use this for initialization void Start() { FutileParams futileParams = new FutileParams(true, true, true, true); manager = new MouseManager(this); futileParams.AddResolutionLevel(800, 1, 1, ""); futileParams.origin = new Vector2( 0.0f, 0.0f); Futile.instance.Init(futileParams); Futile.atlasManager.LoadImage("grasstile"); Futile.atlasManager.LoadImage("foresttile"); Futile.atlasManager.LoadImage("soldier"); Futile.atlasManager.LoadImage("bluehighlight"); var tileSize = 30; var width = 50; var height = 35; var tiles = new TileProperties[width, height]; var grassTile = new TileProperties() { SpriteName = "grasstile", MovementPenalty = 1 }; var forestTile = new TileProperties() { SpriteName = "foresttile", MovementPenalty = 2 }; var actorProps = new ActorProperties() { SpriteName = "soldier", Name = "Hunkfort", MovementPoints = 5 }; var rand = new System.Random(); for (int ii = 0; ii < width; ii++) { for (int jj = 0; jj < height; jj++) { tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile; } } this.map = new Map(tiles, tileSize); this.map.AddActor(actorProps, new Vector2i(5, 5)); this.map.Start(); tileStage = new FStage("test"); Futile.AddStage(tileStage); tileStage.stage.AddChild(this.map); }
public void AddActor(ActorProperties actorProperties, Vector2i location) { var actor = new Actor(actorProperties); actor.x = this.tileSize * location.X + this.halfTileSize; actor.y = this.tileSize * location.Y + this.halfTileSize; actor.width = actor.height = this.tileSize; this.actorToPoint.Add(actor, location); this.pointToActor.Add(location, actor); }
// Use this for initialization void Start() { client.SelfInfoPacketEvent += UpdateClientInfo; client.StatusPacketEvent += UpdateStatus; client.FirstPositionPacketEvent += UpdateClientInfo; properties = SM.userActorManager.clientProperties[client]; properties.SelectionChangedEvent += OnSelectionChanged; _mainCamera = GameObject.Find("Main Camera").GetComponent <CameraMovement>(); }
// Use this for initialization void Start() { FutileParams futileParams = new FutileParams(true, true, true, true); manager = new MouseManager(this); futileParams.AddResolutionLevel(800, 1, 1, ""); futileParams.origin = new Vector2( 0.0f, 0.0f); Futile.instance.Init(futileParams); Futile.atlasManager.LoadImage("grasstile"); Futile.atlasManager.LoadImage("foresttile"); Futile.atlasManager.LoadImage("soldier"); Futile.atlasManager.LoadImage("bluehighlight"); var tileSize = 30; var width = 50; var height = 35; var tiles = new TileProperties[width, height]; var grassTile = new TileProperties() { SpriteName = "grasstile", MovementPenalty = 1 }; var forestTile = new TileProperties() { SpriteName = "foresttile", MovementPenalty = 2 }; var actorProps = new ActorProperties() { SpriteName = "soldier", Name = "Hunkfort", MovementPoints = 5 }; var rand = new System.Random(); for (int ii = 0; ii < width; ii++) { for (int jj = 0; jj < height; jj++) { tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile; } } this.map = new Map(tiles, tileSize); this.map.AddActor(actorProps, new Vector2i(5, 5)); this.map.Start(); tileStage = new FStage("test"); Futile.AddStage(tileStage); tileStage.stage.AddChild(this.map); }
public void AddActor(ActorProperties actorProperties, Vector2i location, bool isEnemy = false) { var actor = new Actor(actorProperties); actor.TurnState = ActorState.TurnStart; actor.IsEnemy = isEnemy; actor.x = this.tileSize * location.X + this.halfTileSize; actor.y = this.tileSize * location.Y + this.halfTileSize; actor.width = actor.height = this.tileSize; this.actorToPoint.Add(actor, location); this.pointToActor.Add(location, actor); }
public static void LoadAvatarFromId(string id) { //get my actor ID int actor = Functions.GetPhotonId(PlayerManager.GetPlayer(APIUser.CurrentUser.id)); //set avatar ID in keyvaluepair List <KeyValuePair <object, object> > kpList = new List <KeyValuePair <object, object> >() { ActorProperties.SetAvatarId(id), }; PhotonSend.SetProperties(actor, kpList.ToArray()); }
public ActorDefinition(UpperString name, Optional <ActorDefinition> parent, int?editorNumber = null) { Name = name; Parent = parent; EditorNumber = editorNumber; States = new ActorStates(this); if (parent) { Flags = new ActorFlags(parent.Value.Flags); Properties = new ActorProperties(parent.Value.Properties); States = new ActorStates(this, parent.Value.States, parent.Value.Name); ActorType = new ActorTypes(parent.Value.ActorType); } }
void Awake() { //Cache references to other actor components. OwnerStats = GetComponent <Stats>(); ActorData = GetComponent <IDData>(); Animator = GetComponent <Animator>(); MeshController = GetComponent <SetMeshFor2D>(); Coll = GetComponent <BoxCollider>(); ColManager = GetComponent <CollisionManager>(); ActorProps = GetComponent <ActorProperties>(); PlayerProps = GetComponent <PlayerProperties>(); CameraConsts = WorldConstants.ConstantsOwner.GetComponent <CameraConstants>(); }
public Actor(ActorProperties actorProperties) : base(actorProperties == null ? "unknown" : actorProperties.SpriteName) { this.Properties = actorProperties; }
// Use this for initialization void Start() { FutileParams futileParams = new FutileParams(true, true, true, true); futileParams.AddResolutionLevel( 1024, 1, 1, ""); futileParams.origin = new Vector2( 0f, 0f); Futile.instance.Init(futileParams); Futile.atlasManager.LoadImage("grasstile"); Futile.atlasManager.LoadImage("foresttile"); Futile.atlasManager.LoadImage("soldier"); Futile.atlasManager.LoadImage("bluehighlight"); Futile.atlasManager.LoadImage("whitetile"); var tileSize = 30; var width = 12; var height = 12; var tiles = new TileProperties[width, height]; var grassTile = new TileProperties() { SpriteName = "grasstile", MovementPenalty = 1 }; var forestTile = new TileProperties() { SpriteName = "foresttile", MovementPenalty = 2 }; var actorProps = new ActorProperties() { SpriteName = "soldier", Name = "Hunkfort", MovementPoints = 5 }; var rand = new System.Random(); for (int ii = 0; ii < width; ii++) { for (int jj = 0; jj < height; jj++) { tiles[ii, jj] = (rand.NextDouble() < 0.7) ? grassTile : forestTile; } } this.map = new Map(tiles, tileSize); this.map.AddActor(actorProps, new Vector2i(5, 5)); this.map.InitializeStage(); var result = Pathfinder.Pathfind(map, map.GetActor(new Vector2i(5, 5))); foreach (var item in result.Distance.Keys) { FSprite highlight = new FSprite("bluehighlight"); highlight.x = item.X * tileSize + tileSize / 2; highlight.y = item.Y * tileSize + tileSize / 2; highlight.width = highlight.height = tileSize; Futile.stage.AddChild(highlight); } }
public Actor(ActorProperties actorProperties) : base(actorProperties == null ? "unknown" : actorProperties.SpriteName) { this.Properties = actorProperties; }
public void AddActor(ActorProperties actorProperties, Vector2i location, bool isEnemy = false) { var actor = new Actor(actorProperties); actor.TurnState = ActorState.TurnStart; actor.IsEnemy = isEnemy; actor.x = this.tileSize * location.X + this.halfTileSize; actor.y = this.tileSize * location.Y + this.halfTileSize; actor.width = actor.height = this.tileSize; this.actorToPoint.Add(actor, location); this.pointToActor.Add(location, actor); }