Beispiel #1
0
        private bool isAvailableFilter(ActorData actor, out ActorObject filter)
        {
            filter = settingsActors.FirstOrDefault(x => x.Enabled && x.ActorType == ActorType.ActorType_All && x.ActorIds.Contains(actor.ActorId));

            if (filter != null)
            {
                return(true);
            }

            filter = settingsActors.FirstOrDefault(x => x.Enabled && x.ActorType == ActorType.ActorType_All && x.ActorIds[0] == 0);

            if (filter != null)
            {
                return(true);
            }

            filter = settingsActors.FirstOrDefault(x => x.Enabled && x.ActorType == actor.ActorType && x.ActorIds.Contains(actor.ActorId));

            if (filter != null)
            {
                return(true);
            }

            filter = settingsActors.FirstOrDefault(x => x.Enabled && x.ActorType == actor.ActorType && x.ActorIds[0] == 0);

            if (filter != null)
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
    public override void BePickup(ActorObject actor)
    {
        ResSkill data = DataReader <ResSkill> .Get(SkillId);

        if (data == null)
        {
            return;
        }
        switch ((Skill.ESkillType)data.type)
        {
        case Skill.ESkillType.Bullet:
            GamingSys.Instance.Player.Bullet += data.bullet;
            break;

        case Skill.ESkillType.Food:
            GamingSys.Instance.Player.Food += data.food;
            break;

        case Skill.ESkillType.HpPack:
            GamingSys.Instance.Player.AddHp(data.hp);
            break;

        default:
            actor.Attr.Add(new SkillAttr(data));
            break;
        }
        LeaveScene();
    }
        // private async Task SendOutNotifications(BaseObject post)
        // {
        //     if (post.PostType == PostType.Text)
        //     {
        //         await SendOutNotificationsToTagFollowers(post);
        //         await SendOutNotificationsToPosterFollowers(post);
        //         await SendOutNotificationsToMentioned(post);
        //     }
        // }

        // private async Task SendOutNotificationsToTagFollowers(BaseObject post)
        // {
        //     var tagIds = post.Tags.Select(t => t.Tag).ToArray();
        //     var tagFollowers = await _dbContext.FollowingPostTags.Where(f => tagIds.Contains(f.Tag)).Select(u => u.UserId).Distinct().ToArrayAsync();
        //     if (tagFollowers.Length > 0)
        //     {
        //         await _notifications.Publish(new Models.AhPushIt.Notification() {
        //             FromUserId = post.UserId,
        //             SubjectId = post.Id,
        //             Priority = NotificationPriority.Normal,
        //             Subject = ReactionSubject.Post,
        //             Type = NotificationType.TEXT_POST_FOLLOWED_TAG,
        //         }, tagFollowers.Select(id => new PublicId(id, 0)).ToArray());
        //     }
        // }

        // private async Task SendOutNotificationsToMentioned(BaseObject post)
        // {
        //     if (post.Mentions.Count > 0)
        //     {
        //         await _notifications.Publish(new Models.AhPushIt.Notification() {
        //             FromUserId = post.UserId,
        //             SubjectId = post.Id,
        //             Priority = NotificationPriority.Normal,
        //             Subject = ReactionSubject.Post,
        //             Type = NotificationType.TEXT_POST_MENTION,
        //         }, post.Mentions.Select(u => new PublicId(u.MentionedUserId, u.MentionedUserPeerId)).ToArray());
        //     }
        // }

        public async Task <BaseObject> TryCreateTextPost(ActorObject publisher, string content, Visibility visibility)
        {
            if (string.IsNullOrWhiteSpace(content))
            {
                return(new Error
                {
                    statusCode = 403,
                    errorCode = 403,
                    summary = "content is empty"
                });
            }
            var audience     = visibility.ToAudience(publisher ?? throw new ArgumentNullException(nameof(publisher)));
            var audienceList = audience?.IntoNewList <BaseObject>()?.ToCollection();
            var from         = publisher.IntoNewList <BaseObject>().ToCollection();
            var post         = new Create
            {
                obj = new Note()
                {
                    content  = content,
                    audience = audienceList,
                    from     = from,
                },
                from = from,
                to   = audienceList,
            };

            return((await _activityStreams.Post("outbox", post)) ?? post);
        }
Beispiel #4
0
    private void OnSysMovement(EventCenterData data)
    {
        object[]    datas     = data.data as object[];
        ActorObject actorBase = null;

        if (sceneObjs.TryGetValue((uint)datas[0], out actorBase))
        {
            actorBase.transform.position = (Vector3)datas[1];
        }
    }
Beispiel #5
0
        public BoardActor()
        {
            myAsset     = null;
            myInterface = null;

            receivesInput = true;
            location      = new Point(0, 0);
            name          = "";
            rotation      = 0;
        }
Beispiel #6
0
    public void Register(ActorObject actor)
    {
        ActorsListItem listItem = new ActorsListItem();

        listItem.initiativeCount = actor.RollInitiative();
        listItem.actor           = actor;

        int actorsCount = InsertListItem(listItem);

        Debug.Log("Registered actorsCount = " + actorsCount);
    }
Beispiel #7
0
    //行動決定時の処理
    //ターゲット表示の位置を渡す(単体用でエフェクト表示に使用する)
    public void Implement_DecideAct(int tergetNum, Vector3[] tergetPos)
    {
        ActorObject actorObject = new ActorObject();

        actorObject.actorNum = mCharacterDataSingleton.GetSelectingCharacter();
        actorObject.speed    = mCharacterDataSingleton.CharaSpeed(actorObject.actorNum);
        actorObject.actor    = eActorScope.Friend;

        //保持している行動者のスキルIDを渡す(キャンセル操作に注意)
        actorObject.skillID = mActorSkillID;

        //ターゲットの渡す
        actorObject.terget    = mTergetScope;
        actorObject.tergetNum = tergetNum;
        actorObject.tergetPos = tergetPos;

        mBattleStateDataSingleton.ActorObject = actorObject;


        //パーティ最大人数は4であり、4以上である場合は行動選択画面を終了する
        if (4 > mCharacterDataSingleton.GetSelectingCharacter())
        {
            //次のキャラを行動可能状態にする
            mCharacterStatusController
            .SetFocus_Character(mCharacterDataSingleton.NextSelectingCharacter());
            //行動をデフォルトに戻す
            SetUIDefault();
        }
        else
        {
            //敵の行動を自動選択により設定する
            for (int i = 0; i < mEnemiesDataSingleton.EnemiesNum; i++)
            {
                mBattleStateDataSingleton.ActorObject = mEnemiesDataSingleton.getAutoActorData();
            }

            //ターゲットを非表示にする
            UIState(false, eTergetScope.Hide);

            //暫定的に行動順
            mCharacterStatusController.SetNoFocus();
            //前の状態を更新する
            mUIpreviousstate = mUIstate;

            //戦闘画面状態を敵ターゲット選択状態にする
            mBattleStateDataSingleton.BattleStateMode
                = BattleStateDataSinglton.eBattleState.eBattleState_SelectEnd;
        }
    }
Beispiel #8
0
    private void CreateButton <T>(MenuSettings <T> settings) where T : UnityEngine.Object
    {
        EditorGUILayout.BeginHorizontal();
        T[]      objs  = FindObjectsOfType <T>();
        string[] names = objs.Select(x => x.name).ToArray();
        string   msg   = "";

        if (ArrayUtility.Contains(names, settings.name))
        {
            msg = "Duplicate name"; GUI.enabled = false;
        }
        if (settings.name == "")
        {
            msg = "Empty Name"; GUI.enabled = false;
        }
        EditorGUILayout.LabelField(msg, GUILayout.Width(197));
        if (GUILayout.Button("Create", LayoutSettings.buttonOp))
        {
            GameObject obj = new GameObject(settings.name);
            //Controller.
            if (typeof(T) == typeof(ControllerOutput))
            {
                //Create Controller.
                ControllerObject cont = (ControllerObject)obj.AddComponent(System.Type.GetType(string.Format("Gimbl.{0}", contType.ToString())));
                cont.InitiateController();
                //Create general Output Object and link.
                ControllerOutput contOut = obj.AddComponent <ControllerOutput>();
                contOut.master = cont;
                // Select created.
                settings.selectedObj = contOut as T;
            }
            //Actor.
            if (typeof(T) == typeof(ActorObject))
            {
                ActorObject act = obj.AddComponent <ActorObject>();
                act.InitiateActor(actorModels[selectedModel], trackCam);
                settings.selectedObj = act as T;
            }
            //Path.
            if (typeof(T) == typeof(PathCreator))
            {
                CreatePath(settings as MenuSettings <PathCreator>, obj);
            }
            settings.name = "";
        }
        EditorGUILayout.EndHorizontal();
    }
Beispiel #9
0
 public void NextTurn(ActorObject lastActor)
 {
     //lastActor can be used as a errorCheck value, if all goes well we do not need it.
     currentNode = currentNode.Next;
     //null means everyone has made action on their turn and we can start a new turn.
     if (currentNode == null)
     {
         //everyone has moved, so start whole next round
         StartRound();
     }
     else
     {
         //we can advance with next turn in initiative track
         //currentNode.Value.actor.StartTurn();
         StartCoroutine(SignalStartTurn(currentNode.Value.actor));
     }
 }
        public async Task <BaseObject> Undo(ActorObject actor, BaseObject toActivity)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }
            else if (toActivity == null)
            {
                throw new ArgumentNullException(nameof(toActivity));
            }
            return(await Post("outbox", new Undo
            {
                actor = actor.IntoNewList <BaseObject>().ToCollection(),
                obj = toActivity,
            }));

            //await _activityStream.Undo(new ActivityStreamFilter("outbox") { id = user.PublicId, targetId = new PublicId(undo) });
            //await _reactions.UnReact(user.PublicId, toId, t);
        }
Beispiel #11
0
    //自動行動用のデータ
    public ActorObject getAutoActorData()
    {
        ActorObject actorObject = new ActorObject();

        Vector3[] friendPositions = GetPosition("CharacterStatus");

        actorObject.actorNum = -1;
        actorObject.speed    = 100;
        actorObject.actor    = eActorScope.Enemy;

        //保持している行動者のスキルIDを渡す(キャンセル操作に注意)
        actorObject.skillID = 12;

        //ターゲットの渡す
        actorObject.terget    = eTergetScope.forOne;
        actorObject.tergetNum = 2;
        actorObject.tergetPos = friendPositions;

        return(actorObject);
    }
Beispiel #12
0
    // create a player connection
    // note: connection can be null
    static ActorObject CreateActor(BoltConnection connection)
    {
        ActorObject p;

        // create a new player object and assign the connection property in it
        p            = new ActorObject();
        p.connection = connection;

        // if there is a connection...
        // the player is assigned as the USER DATA for the connection
        // so that we can associated connection to player
        if (p.connection != null)
        {
            p.connection.UserData = p;
        }

        // add to list of players
        actors.Add(p);

        return(p);
    }
Beispiel #13
0
        private async Task BindSqlActor(ActivityDeliveryContext ctx, ActorObject bindTo)
        {
            if (bindTo.PublicId != null && bindTo.PublicId.IsLocal && bindTo.PublicId.Id.HasValue)
            {
                var profile = await _db.Users.FindAsync(bindTo.PublicId.Id.Value);

                if (profile != null)
                {
                    bindTo.name       = profile.DisplayName;
                    bindTo.Handle     = profile.Handle;
                    bindTo.BanExpires = profile.BanExpires;
                    bindTo.BanReason  = profile.BanReason;
                    bindTo.summary    = profile.Bio;
                    //bindTo.content = content.Content;
                    //bindTo.mediaType = content.MediaType;
                    //bindTo.vis = content.Visibility;
                    bindTo.published = profile.WhenCreated;
                    bindTo.updated   = profile.WhenLastUpdated;
                    bindTo.deleted   = profile.WhenDeleted;
                    //bindTo.IsMature = profile.IsMature;
                }
            }
        }
Beispiel #14
0
        public static ActorObject ToAudience(this Visibility visibility, ActorObject publisher)
        {
            switch (visibility)
            {
            case Visibility.HIDDEN:
                return(publisher);

            case Visibility.VISIBLE_TO_REGISTERED:
                return(new Common.Group {
                    Handle = "registered"
                });

            case Visibility.VISIBLE_TO_FOLLOWERS:
                return(new Common.Group {
                    Handle = "followers"
                });

            case Visibility.VISIBLE_TO_WORLD:
                return(null);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #15
0
 public void setInterfaceObject(ActorObject ao)
 {
     myInterface = ao;
     ao.setActor(this);
 }
Beispiel #16
0
 /// <summary>
 /// 被拾起
 /// </summary>
 /// <param name="other"></param>
 public abstract void BePickup(ActorObject actor);
Beispiel #17
0
    // Use this for initialization
    //エフェクトを自動で表示
    public void _Update()
    {
        //一時的なゲームオブジェクト
        GameObject temp = null;

        switch (mAutoStatus)
        {
        case eAutoStatus.eAutoStatus_Start:
            //状態フラグ変更
            mAutoStatus = eAutoStatus.eAutoStatus_Act;

            //行動者オブジェクト取得
            ActorObject actor = mBattleStateDataSinglton.ActorObject;

            //行動対象キャラクターにフォーカス移動
            mCharacterStatusController.SetFocus_Character(actor.actorNum);


            //ローカル変数定義
            GameObject parentObject = null;
            parentObject = GameObject.Find("Canvas");

            //技名
            GameObject prefab_ActionText = null;
            //親を指定し、技名ウインドウを作成する
            prefab_ActionText = Instantiate((GameObject)Resources.Load("Prefabs/Action_Text"));
            prefab_ActionText.transform.SetParent(parentObject.transform);
            prefab_ActionText.GetComponent <DestoroyAtTime>().delayTime = 0.0f;
            prefab_ActionText.GetComponentInChildren <Text>().text
                = mSkillDataSingleton.GetSkillName(actor.skillID);

            //エフェクト表示
            EffectManager mEffectManager = new EffectManager();
            mEffectManager.MakePrefab("FT_Infinity_lite/_Prefabs/Buff/Discharge_Lightning");
            mEffectManager.SetPosition(actor.tergetPos[actor.tergetNum]);

            //ダメージを表示させる
            GameObject prefab_Damage = null;
            //親を指定し、技名ウインドウを作成する
            prefab_Damage = Instantiate((GameObject)Resources.Load("Prefabs/Damage_Text"));
            prefab_Damage.transform.SetParent(parentObject.transform);
            Vector3 posDamage = new Vector3(actor.tergetPos[actor.tergetNum].x, 400);
            prefab_Damage.transform.position = posDamage;

            break;

        case eAutoStatus.eAutoStatus_Act:
            //攻撃エフェクト~ダメージ消去まで表示されたら終了ステータスへ
            temp = GameObject.FindGameObjectWithTag("AutoState_Act");

            if (temp == null)
            {
                GameObject dummy = new GameObject();
                dummy.tag = "AutoState_End";
                //適当な時間待っている。調整は必要?そこまで必要ではない Slip 2017/08/05
                Destroy(dummy, 0.1f);

                //行動後のオブジェクトを消去する
                mBattleStateDataSinglton.RemoveTopActor();

                mAutoStatus = eAutoStatus.eAutoStatus_End;
            }

            break;

        case eAutoStatus.eAutoStatus_End:
            //ウェイト時間経過後に次の行動へ移行する
            temp = GameObject.FindGameObjectWithTag("AutoState_End");

            if (temp == null)
            {
                if (mBattleStateDataSinglton.ActorObject != null)
                {
                    mAutoStatus = eAutoStatus.eAutoStatus_Start;
                }
                else
                {
                    mBattleStateDataSinglton.BattleStateMode
                        = BattleStateDataSinglton.eBattleState.eBattleState_AutoEnd;
                }
            }

            break;

        default:
            break;
        }
    }
Beispiel #18
0
        public Actors(string FileName, string PackageName = "")
        {
            if (FileName.FileExists() == false)
            {
                throw new System.IO.FileNotFoundException(FileName);
            }
            BaseDirectory = FileName.GetDirectoryFromFileLocation();

            XElement xelement = XElement.Load(FileName);

            this.ID          = xelement.Element("id").Value;
            this.Name        = xelement.Element("name").Value;
            this.DisplayName = xelement.Element("displayname").Value;
            this.Description = xelement.Element("description").Value;
            this.AuthorName  = xelement.Element("author").Value;
            this.UpdateDate  = xelement.Element("date").Value;
            this.PackageName = PackageName;

            IEnumerable <XElement> ActorObjects = xelement.Elements().Where(x => x.Name.ToString() == "actors");

            foreach (var ActorObject in ActorObjects.Elements().Where(x => x.Name.ToString() == "actor"))
            {
                ActorInfo _NewActor = new ActorInfo();
                _NewActor.ID                = ActorObject.Element("id").Value;
                _NewActor.Name              = ActorObject.Element("name").Value;
                _NewActor.DisplayName       = ActorObject.Element("displayname").Value;
                _NewActor.Description       = ActorObject.Element("description").Value;
                _NewActor.AuthorName        = ActorObject.Element("author").Value;
                _NewActor.UpdateDate        = ActorObject.Element("date").Value;
                _NewActor.DefaultFrameDelay = ActorObject.Element("defaultframedelay").Value.ToInt(0);

                IEnumerable <XElement> ActorAnimationObjects = ActorObject.Elements().Where(x => x.Name.ToString() == "animations");
                foreach (var ActorAnimationObject in ActorAnimationObjects.Elements().Where(x => x.Name.ToString() == "animation"))
                {
                    ActorAnimation _NewAnimation = new ActorAnimation();
                    _NewAnimation.Name     = ActorAnimationObject.Element("name").Value;
                    _NewAnimation.Filename = ActorAnimationObject.Element("filename").Value;

                    if (System.IO.File.Exists(this.BaseDirectory + _NewAnimation.Filename) == false)
                    {
                        this.LoadErrors.Add(_NewActor.ID + "-" + _NewAnimation.Name + "-Error Locating Image File", this.BaseDirectory.EnsureDirectoryFormat() + _NewAnimation.Filename);
                        continue;
                    }
                    if (this.Images.ContainsKey(_NewAnimation.Filename))
                    {
                    }
                    else
                    {
                        this.Images.Add(_NewAnimation.Filename, new CompressibleImage(System.Drawing.Image.FromFile(this.BaseDirectory.EnsureDirectoryFormat() + _NewAnimation.Filename), System.Drawing.Imaging.ImageFormat.Png));
                    }

                    _NewAnimation.Direction = ActorAnimationObject.Element("direction").Value;

                    try
                    {
                        _NewAnimation.DirectionValue = (Enumerations.RelativePosition)Enum.Parse(typeof(Enumerations.RelativePosition), _NewAnimation.Direction);
                    }
                    catch
                    {
                        LoadErrors.Add(_NewActor.ID + "-Animation-" + _NewAnimation.Name + "Direction", "Animation: " + _NewAnimation.Name + " - Error Converting Direction");
                    }

                    IEnumerable <XElement> ActorAnimationFrameObjects = ActorAnimationObject.Elements().Where(x => x.Name.ToString() == "frames");
                    foreach (var ActorAnimationFrameObject in ActorAnimationFrameObjects.Elements().Where(x => x.Name.ToString() == "frame"))
                    {
                        ActorAnimationFrame _NewFrame = new ActorAnimationFrame();
                        _NewFrame.ID = ActorAnimationFrameObject.Attribute("id").Value.ToInt(-1);
                        if (ActorAnimationFrameObject.Attribute("nextid").Value.StartsWith("{"))
                        {
                            // TODO Add Split Method
                        }
                        else
                        {
                            _NewFrame.NextID.Add(ActorAnimationFrameObject.Attribute("nextid").Value.ToInt(-1));
                        }

                        var DrawingRec2 = ActorAnimationFrameObject.Attribute("imagerec").Value.ToRectangle();
                        if (DrawingRec2 == System.Drawing.Rectangle.Empty)
                        {
                            _NewFrame.ImageRect = Microsoft.Xna.Framework.Rectangle.Empty;
                            LoadErrors.Add(_NewActor.ID + "-Animation-" + _NewAnimation.Name + "-Frame-" + _NewFrame.ID.ToString(), "Invalid Source Rect");
                        }
                        else
                        {
                            _NewFrame.ImageRect = new Microsoft.Xna.Framework.Rectangle(DrawingRec2.X, DrawingRec2.Y, DrawingRec2.Width, DrawingRec2.Height);
                        }

                        try
                        {
                            var Anchor = ActorAnimationFrameObject.Attribute("anchor").Value;

                            string[] _Points = Anchor.SplitString(",", StringSplitOptions.RemoveEmptyEntries);
                            if (_Points.Length == 2)
                            {
                                _NewFrame.Anchor = new Vector2(_Points[0].ToInt(0), _Points[1].ToInt(0));
                            }
                            else
                            {
                                _NewFrame.Anchor = new Vector2(0, 0);
                            }
                        }
                        catch
                        {
                            _NewFrame.Anchor = new Vector2(0, 0);
                        }

                        try
                        {
                            _NewFrame.Delay = ActorAnimationFrameObject.Attribute("delay").Value.ToInt(_NewActor.DefaultFrameDelay);
                        }
                        catch
                        {
                            _NewFrame.Delay = _NewActor.DefaultFrameDelay;
                        }

                        _NewAnimation.Frames.Add(_NewFrame.ID, _NewFrame);
                    }

                    if (_NewActor.Animations.ContainsKey(_NewAnimation.Name + _NewAnimation.Direction))
                    {
                        LoadErrors.Add(_NewActor.ID + "-Animation-" + _NewAnimation.Name + "-DuplicateAnimationName", "AnimationName: " + _NewAnimation.Name + _NewAnimation.Direction + " - Duplicate Animation Name Found");
                    }
                    else
                    {
                        _NewActor.Animations.Add(_NewAnimation.Name + _NewAnimation.Direction, _NewAnimation);
                    }
                }

                AllActors.Add(_NewActor.Name, _NewActor);
            }
        }
Beispiel #19
0
 void Start()
 {
     actorObject = GetComponentInParent <ActorObject>();
 }
Beispiel #20
0
 private void Start()
 {
     // TODO: Refactor to not need to lookup object, This needs to be set dynamically via the visual scripting UI
     _actorObject = GameObject.FindWithTag("PawnObject").GetComponent <ActorObject>();
 }
Beispiel #21
0
    protected IEnumerator SignalStartTurn(ActorObject actor)
    {
        yield return(new WaitForSeconds(turnDelay));

        actor.StartTurn();
    }
Beispiel #22
0
 public virtual void SetOwner(ActorObject owner)
 {
     Owner = owner;
 }
Beispiel #23
0
 public override void BePickup(ActorObject actor)
 {
     actor.AddItem(this);
 }