These (byte) values define "well known" properties for an Actor / Player.
"Custom properties" have to use a string-type as key. They can be assigned at will.
예제 #1
0
파일: Actor.cs 프로젝트: hunktop/awayteam
 public Actor(ActorProperties properties, Team team)
     : base(properties.SpriteName)
 {
     this.ID         = IdCounter++;
     this.Team       = team;
     this.Properties = properties;
 }
예제 #2
0
파일: Actor.cs 프로젝트: HaKDMoDz/awayteam
 public Actor(ActorProperties properties, Team team)
     : base(properties.SpriteName)
 {
     this.ID = IdCounter++;
     this.Team = team;
     this.Properties = properties;
 }
예제 #3
0
    void Start()
    {
        PlayProps  = GetComponent <PlayerProperties>();
        ActorProps = GetComponent <ActorProperties>();

        PlayConsts  = WorldConstants.ConstantsOwner.GetComponent <PlayerConstants>();
        ActorConsts = WorldConstants.ConstantsOwner.GetComponent <ActorConstants>();
    }
예제 #4
0
 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;
 }
예제 #5
0
파일: Map.cs 프로젝트: HaKDMoDz/awayteam
 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);
 }
예제 #6
0
 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);
 }
예제 #7
0
    // 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);
    }
예제 #8
0
    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);
    }
예제 #9
0
    // 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>();
    }
예제 #10
0
    // 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);
    }
예제 #11
0
    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);
    }
예제 #12
0
        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());
        }
예제 #13
0
        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);
            }
        }
예제 #14
0
    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>();
    }
예제 #15
0
파일: Actor.cs 프로젝트: HaKDMoDz/awayteam
 public Actor(ActorProperties actorProperties)
     : base(actorProperties == null ? "unknown" : actorProperties.SpriteName)
 {
     this.Properties = actorProperties;
 }
예제 #16
0
    // 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);
        }
    }
예제 #17
0
 public Actor(ActorProperties actorProperties)
     : base(actorProperties == null ? "unknown" : actorProperties.SpriteName)
 {
     this.Properties = actorProperties;
 }
예제 #18
0
파일: Map.cs 프로젝트: HaKDMoDz/awayteam
 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);
 }