Ejemplo n.º 1
0
        public IHttpActionResult PostACT(ACT aCT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.ACT.Add(aCT);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (ACTExists(aCT.CodigoACT))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtRoute("DefaultApi", new { id = aCT.CodigoACT }, new ACTDTO(aCT)));
        }
Ejemplo n.º 2
0
    void OnMouseDown()
    {
        if (InGame == true && PlayerManager.GetInst().Players[PlayerManager.GetInst().CurTurnIdx].act != ACT.STUN)
        {
            if (CostManager.GetInst().cur_cost_num >= cost)
            {
                if (On_active == true)
                {
                    PlayerBase pb = PlayerManager.GetInst().Players[PlayerManager.GetInst().CurTurnIdx];
                    Manager.GetInst().MoveCamPosToTile(pb.CurHex);
                    PlayerManager.GetInst().HilightSummons();

                    act = ACT.SUMMONES;
                    CostManager.GetInst().CostDecrease(cost);
                    On_active = false;
                }
            }
        }
        else
        {
            if (PlayerManager.GetInst().Players[PlayerManager.GetInst().CurTurnIdx].act != ACT.STUN)
            {
                CardLoadManager.GetInst().OnCard(summon_id);
            }
        }
    }
Ejemplo n.º 3
0
        public IHttpActionResult PutACT(string id, ACT aCT)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != aCT.CodigoACT)
            {
                return(BadRequest());
            }

            db.Entry(aCT).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ACTExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 4
0
    // Update is called once per frame
    void Update()
    {
        if (event_mode == true && act == ACT.IDLE)
        {
            Vector3 v = transform.position;
            v.z += Time.deltaTime * 2;
            v.y += Time.deltaTime;
            Vector3 r = transform.rotation.eulerAngles;
            r.x += Time.deltaTime * 5;
            transform.rotation = Quaternion.Euler(r);

            transform.position = v;
            if (v.z > 14)
            {
                act = ACT.MOVING;
            }
        }
        if (act == ACT.MOVING)
        {
            SetPosition(new Vector3(-0.61f, 4.35f, 7.72f));
            Vector3 r = transform.rotation.eulerAngles;
            r.x                = 20;
            r.y                = 165.2f;
            InitRot            = r;
            transform.rotation = Quaternion.Euler(r);

            GUIManager.GetInst().CreateTalkBox();
            act = ACT.SUMMONES;
        }
    }
Ejemplo n.º 5
0
    // Update is called once per frame
    void Update()
    {
        Vector3 v = transform.position;

        if (v.x >= -95)
        {
            act = ACT.MOVING;
        }

        else if (v.x < -110)
        {
            act = ACT.IDLE;
        }

        if (act == ACT.IDLE)
        {
            v.x += Time.deltaTime;
            transform.rotation = Quaternion.Euler(30, 90, 0);
        }
        else
        {
            v.x -= Time.deltaTime;
            transform.rotation = Quaternion.Euler(-30, 90, 0);
        }
        transform.position = v;
    }
Ejemplo n.º 6
0
    public void MouseInputProc(int btn)
    {
        if (btn == 1)
        {
            //step - aI일때는 리턴

            PlayerBase pb = Players[CurTurnIdx];
            if (pb is AIPlayer)
            {
                return;
            }
            //step1 idle 할일 x
            ACT act = Players[CurTurnIdx].act;
            if (act == ACT.IDLE)
            {
                MapManager.GetInst().ResetMapColor();
                return;
            }
            //step2 attack 무브일떄 하이라이트 초기화
            if (act == ACT.MOVEHILIGHT || act == ACT.ATTACKHIGHLIGHT)
            {
                MapManager.GetInst().ResetMapColor();
                Players[CurTurnIdx].act = ACT.IDLE;

                return;
            }
        }
    }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 private void Awake()
 {
     instance    = this;
     playerInput = new PlayerInput();
     playerInput.TestButtons.T.performed += ctx => TB1?.Invoke();
     playerInput.TestButtons.Y.performed += ctx => TB2?.Invoke();
     playerInput.TestButtons.U.performed += ctx => TB3?.Invoke();
 }
Ejemplo n.º 8
0
    public void Init(SPR spr, ACT act)
    {
        currentSPR = spr;
        currentACT = act;

        currentSPR.SwitchToRGBA();
        sprites = currentSPR.GetSprites();
    }
Ejemplo n.º 9
0
    private static ACT.Animation ReadLayers(ACT act, BinaryReader data)
    {
        var count   = data.ReadULong();
        var layers  = new ACT.Layer[count];
        var version = double.Parse(act.version);

        for (int i = 0; i < count; i++)
        {
            var layer = layers[i] = new ACT.Layer()
            {
                pos      = new Vector2Int(data.ReadLong(), data.ReadLong()),
                index    = data.ReadLong(),
                isMirror = data.ReadLong(),
                scale    = Vector2.one,
                color    = Color.white
            };

            if (version >= 2.0)
            {
                layer.color[0] = data.ReadUByte() / 255f;
                layer.color[1] = data.ReadUByte() / 255f;
                layer.color[2] = data.ReadUByte() / 255f;
                layer.color[3] = data.ReadUByte() / 255f;
                layer.scale[0] = data.ReadFloat();
                layer.scale[1] = version <= 2.3 ? layer.scale[0] : data.ReadFloat();
                layer.angle    = data.ReadLong();
                layer.sprType  = data.ReadLong();

                if (version >= 2.5)
                {
                    layer.width  = data.ReadLong();
                    layer.height = data.ReadLong();
                }
            }
        }

        var soundId = version >= 2.0 ? data.ReadLong() : -1;

        Vector2Int[] pos = null;

        if (version >= 2.3)
        {
            pos = new Vector2Int[data.ReadLong()];
            for (int i = 0; i < pos.Length; i++)
            {
                data.Seek(4, System.IO.SeekOrigin.Current);
                pos[i] = new Vector2Int(data.ReadLong(), data.ReadLong());
                data.Seek(4, System.IO.SeekOrigin.Current);
            }
        }

        return(new ACT.Animation()
        {
            layers = layers,
            soundId = soundId,
            pos = pos
        });
    }
Ejemplo n.º 10
0
        public override void Export(Asset asset, string path)
        {
            Model model = asset as Model;
            ACT   act   = new ACT();

            TravelTree(model.Root, ref act);

            act.Save(path);
        }
Ejemplo n.º 11
0
        public override void Export(Asset asset, string path)
        {
            var model = (asset as Model);
            var act   = new ACT();

            TravelTree(model.Root, ref act, true);

            act.Save(path);
        }
Ejemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        spr = FileManager.Load("data/sprite/cursors.spr") as SPR;
        act = FileManager.Load("data/sprite/cursors.act") as ACT;

        tick = Time.deltaTime;

        FlipTextures();
        SetAction(CursorAction.DEFAULT, true);
    }
Ejemplo n.º 13
0
 public ACTDTO(ACT a)
 {
     if (a == null)
     {
         return;
     }
     CodigoACT      = a.CodigoACT;
     SolicitacaoCod = a.SolicitacaoCod;
     DataAbertura   = a.DataAbertura;
 }
Ejemplo n.º 14
0
        public IHttpActionResult GetACT(string id)
        {
            ACT aCT = db.ACT.Find(id);

            if (aCT == null)
            {
                return(NotFound());
            }

            return(Ok(new ACTDTO(aCT)));
        }
Ejemplo n.º 15
0
 void Awake()
 {
     target         = new Vector3(0, 1, 0);
     inst           = this;
     inst.magics[0] = (GameObject)Resources.Load("magic/fireball");
     inst.magics[1] = (GameObject)Resources.Load("magic/water");
     inst.magics[2] = (GameObject)Resources.Load("magic/wall");
     inst.magics[3] = (GameObject)Resources.Load("magic/waterfall");
     inst.magics[4] = (GameObject)Resources.Load("magic/shield");
     act            = ACT.IDLE;
 }
Ejemplo n.º 16
0
    private static ACT.Animation[] ReadAnimations(ACT act, BinaryReader data)
    {
        var count      = data.ReadULong();
        var animations = new ACT.Animation[count];

        for (int i = 0; i < count; i++)
        {
            data.Seek(32, System.IO.SeekOrigin.Current);
            animations[i] = ReadLayers(act, data);
        }

        return(animations);
    }
Ejemplo n.º 17
0
        private static ACT.Frame[] ReadMotions(ACT act, MemoryStreamReader data)
        {
            var count   = data.ReadUInt();
            var motions = new ACT.Frame[count];

            for (int i = 0; i < count; i++)
            {
                data.Seek(32, System.IO.SeekOrigin.Current);
                motions[i] = ReadLayers(act, data);
            }

            return(motions);
        }
Ejemplo n.º 18
0
    protected void Awake()
    {
        act = ACT.IDLE;             //플레이어의 초기 설정.
        PlayerManager.pm.Players.Add(this);
        pv       = GetComponent <PhotonView>();
        animator = GetComponent <Animator>();

        //내꺼면 ismine check.
        if (pv.isMine)
        {
            CameraControl.cc.m_Targets.Add(transform);
            isMine = true;
        }
    }
Ejemplo n.º 19
0
    public Entity SpawnItem(ItemSpawnInfo itemSpawnInfo)
    {
        Item   item     = DBManager.GetItemInfo(itemSpawnInfo.AID);
        string itemPath = DBManager.GetItemPath(itemSpawnInfo.AID, itemSpawnInfo.IsIdentified);

        ACT act = FileManager.Load(itemPath + ".act") as ACT;
        SPR spr = FileManager.Load(itemPath + ".spr") as SPR;

        var itemGO = new GameObject(item.identifiedDisplayName);

        itemGO.layer = LayerMask.NameToLayer("Items");
        itemGO.transform.localScale    = Vector3.one;
        itemGO.transform.localPosition = itemSpawnInfo.Position;
        var entity = itemGO.AddComponent <Entity>();

        var body = new GameObject("Body");

        body.layer = LayerMask.NameToLayer("Items");
        body.transform.SetParent(itemGO.transform, false);
        body.transform.localPosition = new Vector3(0.5f, 0.4f, 0.5f);
        body.AddComponent <Billboard>();
        body.AddComponent <SortingGroup>();

        if (itemSpawnInfo.animate)
        {
            var animator = body.AddComponent <Animator>();
            animator.runtimeAnimatorController = Instantiate(Resources.Load("Animations/ItemDropAnimator")) as RuntimeAnimatorController;
        }

        var bodyViewer = body.AddComponent <EntityViewer>();

        entity.EntityViewer = bodyViewer;
        entity.Type         = EntityType.ITEM;
        entity.ShadowSize   = 0.5f;

        bodyViewer.ViewerType    = ViewerType.BODY;
        bodyViewer.Entity        = entity;
        bodyViewer.SpriteOffset  = 0.5f;
        bodyViewer.HeadDirection = 0;
        bodyViewer.CurrentMotion = new EntityViewer.MotionRequest {
            Motion = SpriteMotion.Idle
        };

        entity.Init(spr, act);
        entity.AID = (uint)itemSpawnInfo.mapID;
        entityCache.Add(entity.AID, entity);
        entity.SetReady(true);

        return(entity);
    }
Ejemplo n.º 20
0
	public void GetDamage(int dam)
	{
		Status.CurHp -= dam;
		if (Status.CurHp <= 0) {
			Debug.Log ("died");
            anim.SetTrigger("Die");
           act = ACT.DIYING;
           removeTime =+ Time.deltaTime;
			//PlayerManager.instance.RemovePlayer(this);
		}
        else
        {
            anim.SetTrigger("Hited");
        }
	}
Ejemplo n.º 21
0
    void Awake()
    {
        inst = this;
        transform.position = pos;
        InitPos            = pos;
        Default_Iso_x      = xangle;
        Default_Iso_y      = yangle;
        Vector3 r = transform.rotation.eulerAngles;

        r.x                = xangle;
        r.y                = yangle;
        act                = ACT.IDLE;
        InitRot            = r;
        transform.rotation = Quaternion.Euler(r);
    }
Ejemplo n.º 22
0
        public async Task <IActionResult> PosttransitionActions([FromBody] ACT act)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    List <TransitionActions> NewTA      = new List <TransitionActions>();
                    List <TransitionActions> TAToDelete = new List <TransitionActions>();
                    List <TransitionActions> currentTA  = new List <TransitionActions>();
                    List <TransitionActions> TAToAdd    = new List <TransitionActions>();

                    foreach (int id in act.ActionsIds)
                    {
                        NewTA.Add(new TransitionActions {
                            Transition = _unitOfWork.Transition.GetSingleOrDefault(e => e.Id == act.TransitionId),
                            Actions    = _unitOfWork.Actions.GetSingleOrDefault(e => e.Id == id)
                        });
                    }

                    currentTA = _unitOfWork.TransitionActions.Find(e => e.TransitionId == act.TransitionId).ToList();

                    TAToAdd    = NewTA.Except(currentTA).ToList();
                    TAToDelete = currentTA.Except(NewTA).ToList();

                    foreach (var item in TAToDelete)
                    {
                        _unitOfWork.TransitionActions.Remove(item);
                    }
                    await _unitOfWork.SaveChangesAsync();

                    foreach (var item in TAToAdd)
                    {
                        _unitOfWork.TransitionActions.Add(item);
                    }
                    await _unitOfWork.SaveChangesAsync();

                    return(Ok("OK"));
                }
                catch (Exception ex)
                {
                    return(BadRequest(ex.Data));
                }
            }
            else
            {
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 23
0
        public IHttpActionResult DeleteACT(string id)
        {
            ACT aCT = db.ACT.Find(id);

            if (aCT == null)
            {
                return(NotFound());
            }

            ACTDTO a = new ACTDTO(aCT);

            db.ACT.Remove(aCT);
            db.SaveChanges();

            return(Ok(a));
        }
Ejemplo n.º 24
0
 public void GetDamage(int dam)
 {
     Status.CurHp -= dam;
     if (Status.CurHp <= 0)
     {
         Debug.Log("died");
         anim.SetTrigger("Die");
         act        = ACT.DIYING;
         removeTime = +Time.deltaTime;
         //PlayerManager.instance.RemovePlayer(this);
     }
     else
     {
         anim.SetTrigger("Hited");
     }
 }
Ejemplo n.º 25
0
        private static void ReadActions(ACT act, MemoryStreamReader data)
        {
            var count = data.ReadUShort();

            data.Seek(10, System.IO.SeekOrigin.Current);

            act.actions = new ACT.Action[count];
            for (int i = 0; i < count; i++)
            {
                act.actions[i] = new ACT.Action()
                {
                    frames = ReadMotions(act, data),
                    delay  = 150f
                };
            }
        }
Ejemplo n.º 26
0
        public static ACT Load(MemoryStreamReader data)
        {
            string header = data.ReadBinaryString(2);

            if (!header.Equals(ACT.Header))
            {
                throw new Exception("ActionLoader.Load: Header \"" + header + "\" is not \"AC\"");
            }

            string subversion = Convert.ToString(data.ReadByte());
            string version    = Convert.ToString(data.ReadByte());

            version += "." + subversion;

            double dversion = double.Parse(version, CultureInfo.InvariantCulture);

            ACT act = new ACT();

            act.version = version;

            ReadActions(act, data);

            if (dversion >= 2.1)
            {
                //sounds
                var count = data.ReadInt();
                act.sounds = new string[count];

                for (int i = 0; i < count; i++)
                {
                    act.sounds[i] = data.ReadBinaryString(40);
                }

                //delay
                if (dversion >= 2.2)
                {
                    for (int i = 0; i < act.actions.Length; i++)
                    {
                        act.actions[i].delay = data.ReadFloat() * 25;
                    }
                }
            }

            return(act);
        }
Ejemplo n.º 27
0
 public void GetDamage(int damage)
 {
     status.Curhp -= damage;
     if (status.Curhp <= 0)
     {
         if (m_type == Type.GOLEM)
         {
             anim.SetTrigger("Die");
         }
         // hpContorl.GetInst().SetPos(this);
         act         = ACT.DIYING;
         removeTime += Time.deltaTime;
         //PlayerManager.GetInst().RemovePlayer(this);
     }
     if (m_type == Type.GOLEM)
     {
         anim.SetTrigger("Take Damage");
     }
 }
Ejemplo n.º 28
0
        public static void TravelTree(ModelBone bone, ref ACT act, bool root = false)
        {
            act.AddActor(
                bone.Name,
                (bone.Type == BoneType.Mesh && bone.Mesh != null ? bone.Mesh.Name : null),
                new Matrix3D(
                    bone.Transform.M11, bone.Transform.M21, bone.Transform.M31,
                    bone.Transform.M12, bone.Transform.M22, bone.Transform.M32,
                    bone.Transform.M13, bone.Transform.M23, bone.Transform.M33,
                    bone.Transform.M41, bone.Transform.M42, bone.Transform.M43
                    ),
                true
                );

            foreach (var b in bone.Children)
            {
                TravelTree(b, ref act);
                act.AddSubLevelEnd();
            }
        }
Ejemplo n.º 29
0
    public void Start()
    {
        if (currentSPR == null)
        {
            string path = "";

            switch (ViewerType)
            {
            case ViewerType.BODY:
                path = DBManager.GetBodyPath((Job)Entity.Job, Entity.Sex);
                break;

            case ViewerType.HEAD:
                path = DBManager.GetHeadPath(Entity.Hair, Entity.Sex);
                break;

            case ViewerType.WEAPON:
                path = DBManager.GetWeaponPath(Entity.Weapon, Entity.Job, Entity.Sex);
                break;
            }

            currentSPR = FileManager.Load(path + ".spr") as SPR;
            currentACT = FileManager.Load(path + ".act") as ACT;
        }
        currentSPR.SwitchToRGBA();
        sprites      = currentSPR.GetSprites();
        meshCollider = gameObject.GetOrAddComponent <MeshCollider>();

        if (currentAction == null)
        {
            ChangeAction(0);
        }

        foreach (var child in Children)
        {
            child.Start();
        }

        InitShadow();
    }
Ejemplo n.º 30
0
    public Entity SpawnItem(ItemSpawnInfo itemSpawnInfo)
    {
        Item   item     = DBManager.GetItemInfo(itemSpawnInfo.GID);
        string itemPath = DBManager.GetItemPath(itemSpawnInfo.GID, itemSpawnInfo.IsIdentified);

        ACT act = FileManager.Load(itemPath + ".act") as ACT;
        SPR spr = FileManager.Load(itemPath + ".spr") as SPR;

        var itemGO = new GameObject(item.identifiedDisplayName);

        itemGO.layer = LayerMask.NameToLayer("Items");
        itemGO.transform.localScale = Vector3.one;
        var entity = itemGO.AddComponent <Entity>();

        var body = new GameObject("Body");

        body.layer = LayerMask.NameToLayer("Items");
        body.transform.SetParent(itemGO.transform, false);
        body.transform.localPosition = itemSpawnInfo.Position;
        body.AddComponent <Billboard>();
        body.AddComponent <SortingGroup>();

        var bodyViewer = body.AddComponent <EntityViewer>();

        entity.EntityViewer = bodyViewer;
        entity.Type         = EntityType.ITEM;

        bodyViewer.ViewerType    = ViewerType.BODY;
        bodyViewer.Entity        = entity;
        bodyViewer.SpriteOffset  = 0.5f;
        bodyViewer.HeadDirection = 0;
        bodyViewer.CurrentMotion = SpriteMotion.Idle;
        bodyViewer.Type          = entity.Type;

        entity.Init(spr, act);
        entity.GID = (uint)itemSpawnInfo.mapID;
        entity.SetReady(true);

        return(entity);
    }
Ejemplo n.º 31
0
    public void MouseInputProc(int btn)
    {
        if (btn == 1)
        {
            PlayerBase pb = Players[CurTurnIdx];

            if (pb is AIPlayer)
            {
                return;
            }

            ACT act = Players[CurTurnIdx].act;
            if (act == ACT.IDLE)
            {
                return;
            }
            if (act == ACT.MOVEHILIGHT || act == ACT.ATTACKHIGHLIGHT)
            {
                Players[CurTurnIdx].act = ACT.IDLE;
                MapManager.instance.ResetMapColor();
            }
        }
    }