Example #1
0
        public ConversationFragment(bool isPlayer, int SentenceOptions)
        {
            IsPlayer = isPlayer;

            ToSay            = new string[SentenceOptions];
            OptionOutputData = new ConversationData[SentenceOptions];

            for (int idx = 0; idx < SentenceOptions; idx++)
            {
                ToSay[idx]            = string.Empty;
                OptionOutputData[idx] = new ConversationData();
            }

            ShouldRerun = RerunPredicate.Never;
        }
Example #2
0
        public static bool ShouldRerun(RerunPredicate predicate, BaseCharacterController speaker)
        {
            switch (predicate)
            {
            case RerunPredicate.Never:
                return(false);

            case RerunPredicate.Always:
                return(true);

            case RerunPredicate.IfPlayerCantDoubleJump:
                return(App.AIBlackboard.Player.MaxJumps == 1);

            case RerunPredicate.IfPlayerDoesntHaveTriangleAbility:
                return(!App.AIBlackboard.Player.FactionUnlocked(CharacterFaction.Triangle));

            case RerunPredicate.IfPlayerDoesntHaveCircleAbility:
                return(!App.AIBlackboard.Player.FactionUnlocked(CharacterFaction.Circle));

            default:
                Debug.LogErrorFormat("RerunPredicate {0} not implemented", predicate);
                return(false);
            }
        }
Example #3
0
        public ConversationFragment(BinaryReader reader)
        {
            IsPlayer = reader.ReadBoolean();

            int count = reader.ReadInt32();

            ToSay            = new string[count];
            OptionOutputData = new ConversationData[count];

            for (int idx = 0; idx < count; idx++)
            {
                ToSay[idx] = reader.ReadString();
            }

            Output      = (ConversationOutput)reader.ReadInt16();
            IsAvailable = (ConversationPredicate)reader.ReadInt16();

            for (int idx = 0; idx < count; idx++)
            {
                OptionOutputData[idx] = new ConversationData(reader);
            }

            ShouldRerun = (RerunPredicate)reader.ReadInt16();
        }