Beispiel #1
0
 public override MousePoint GetNearestMousePoint(Mouse m, MSTIMULUS localGoal)
 {
     if (MousePoint.points != null && MousePoint.points.Count > 0)
     {
         int   best    = -1;
         float mindist = float.MaxValue;
         for (int i = 0; i < MousePoint.points.Count; ++i)
         {
             if (MousePoint.points[i].type == localGoal && MousePoint.points[i].Availability(m.index) == MPRESPONSE.AVAILABLE &&
                 Mathf.Abs(m.body.tform.position.y - MousePoint.points[i].tform.position.y) < 2)
             {
                 float dist = Vector3.Distance(m.body.tform.position, MousePoint.points[i].tform.position);
                 if (dist < mindist)
                 {
                     best    = i;
                     mindist = dist;
                 }
             }
         }
         if (best > -1)
         {
             return(MousePoint.points[best]);
         }
     }
     return(Mice.CreateAdhocBathroomPoint(m.index, MiceZone.zone.GetWanderPoint()));
 }
Beispiel #2
0
 void CheckMice()
 {
     if (!miceBh)
     {
         miceBh = Globals.player.GetComponent <Mice>();
     }
 }
Beispiel #3
0
 public override void Access(Mice.Mouse mouse)
 {
     foodTotal -= Mice.mice.preset.consumptionRate * Time.deltaTime;
     psys.Emit(1);
     foreach (int m in occupants)
     {
         foreach (int n in occupants)
         {
             if (m != n)
             {
                 Mice.GetMouse(m).IncreaseAffection(n, 0.1f * Time.deltaTime);
             }
         }
     }
     tform.localScale = (foodTotal / originalFoodTotal) * originalScale;
     if (foodTotal < 0)
     {
         foreach (int i in occupants)
         {
             Mice.GetMouse(i).DisengageMousePoint(true);
         }
         MousePoint.points.Remove(this);
         Destroy(gameObject);
     }
 }
Beispiel #4
0
 public Computer(SystemBlock s, Monitor m, Clava c, Mice mi)
 {
     SB   = s;
     MON  = m;
     CL   = c;
     MICE = mi;
 }
Beispiel #5
0
    void Start()
    {
        clickSound = Deer.GetComponent <AudioSource>();
        bgMusic    = GetComponent <AudioSource>();
        int randomnum = Random.Range(0, 5);

        for (int i = 0; i < randomnum; i++)
        {
            randomPos(x);
        }
        check2        = 0;
        check         = 0;
        time          = 0;
        BeariniPost   = Bear.transform.position;
        FoxiniPost    = Fox.transform.position;
        FroginiPost   = Frog.transform.position;
        MiceiniPost   = Mice.transform.position;
        CatiniPost    = Cat.transform.position;
        KanciliniPost = Kancil.transform.position;
        CowiniPost    = Cow.transform.position;
        DeeriniPost   = Deer.transform.position;

        Cat.SetActive(false);
        Cow.SetActive(false);
        Kancil.SetActive(false);
        Bear.SetActive(false);
        Fox.SetActive(false);
        Frog.SetActive(false);
        Mice.SetActive(false);
        buttonnext1.SetActive(false);
    }
Beispiel #6
0
    void Update()
    {
        totalTime += Time.deltaTime;
        if (Mathf.Ceil(totalTime / secondsPerDay) > _day)
        {
            _day = (int)Mathf.Ceil(totalTime / secondsPerDay);
            Mice.NewDay();
            tod = 0;
        }
        tod += Time.deltaTime;
        float normaltod = tod / secondsPerDay;

        slider.value = normaltod;
        if (normaltod > (6 / 24) && normaltod < (18 / 24))
        {
            handle.sprite = dayHandle;
        }
        else
        {
            handle.sprite = nightHandle;
        }
        text.text = "DAY " + _day;
        if (sunday && !isSunday)
        {
        }
    }
Beispiel #7
0
 protected override void OnEngage(Mice.Mouse mouse)
 {
     if (mouse.socializePoint.occupants.Count == 0)
     {
         Mice.GetMouse(body.index).SetSocial(mouse.index, mouse.socializePoint);
     }
 }
Beispiel #8
0
        public SettingsViewModel(IEnumerable <SingleMouseViewModel> mice)
        {
            GapDistanceMin      = 5;
            GapDistanceMax      = 300;
            BinaryThresholdMin  = 0;
            BinaryThresholdMax  = 255;
            BinaryThreshold2Min = 0;
            BinaryThreshold2Max = 255;

            m_GapDistance      = 35;
            m_BinaryThreshold  = 20;
            m_BinaryThreshold2 = 10;
            SmoothMotion       = true;

            ObservableCollection <SingleFileViewModel> singleFiles = new ObservableCollection <SingleFileViewModel>();

            foreach (var mouse in mice)
            {
                foreach (var file in mouse.VideoFiles)
                {
                    singleFiles.Add(new SingleFileViewModel(file, ""));
                }
            }

            Mice = singleFiles;

            using (IVideo video = ModelResolver.Resolve <IVideo>())
            {
                video.SetVideo(Mice.First().VideoFileName);
                FrameRate = video.FrameRate;
            }

            SelectedMouse = Mice.First();
        }
        static void Main(string[] args)
        {
            var parakeet1   = new Parakeets();
            var earthworm1  = new Earthworms();
            var terrapin1   = new Terrapins();
            var timber1     = new TimberRattlesnake();
            var mice        = new Mice();
            var ant1        = new Ants();
            var finch1      = new Finches();
            var bettaFish1  = new BettaFish();
            var copperhead1 = new CopperheadSnake();
            var gerbil1     = new Gerbils();

            DigContainer digContainer = new DigContainer();

            digContainer.diggingAnimals.Add(earthworm1);

            SwimContainer swimContainer = new SwimContainer();

            swimContainer.swimmingAnimals.Add(terrapin1);
            swimContainer.swimmingAnimals.Add(bettaFish1);

            FlyContainer flyContainer = new FlyContainer();

            flyContainer.flyingAnimals.Add(parakeet1);
            flyContainer.flyingAnimals.Add(finch1);

            WalkContainer walkContainer = new WalkContainer();

            walkContainer.walkingAnimals.Add(timber1);
            walkContainer.walkingAnimals.Add(ant1);
            walkContainer.walkingAnimals.Add(mice);
            walkContainer.walkingAnimals.Add(gerbil1);
            walkContainer.walkingAnimals.Add(copperhead1);
        }
Beispiel #10
0
        public VEnvironmentData(NotuiElement element)
        {
            _element               = element;
            TypeCSharpName         = element.GetType().GetCSharpName();
            element.OnMainLoopEnd += (sender, args) =>
            {
                Touches.AssignFrom(_element.Touching.Keys);
                TouchesHitting.AssignFrom(_element.Touching.Values.Select(t => t != null));
                TouchingIntersections.AssignFrom(_element.Touching.Values.Where(t => t != null));
                HittingTouches.AssignFrom(_element.Hitting.Keys);
                HittingIntersections.AssignFrom(_element.Hitting.Values);
                Mice.AssignFrom(_element.Mice.Select(t => t.AttachadMouse));
                Children.AssignFrom(_element.Children.Values);
                Behaviors.AssignFrom(_element.Behaviors);

                if (_element.Parent == null)
                {
                    Parent.SliceCount = 0;
                }
                else
                {
                    Parent.SliceCount = 1;
                    Parent[0]         = element.Parent;
                }

                VDispTr = _element.DisplayMatrix.AsVMatrix4X4();
            };
        }
Beispiel #11
0
 public override MPRESPONSE Availability(int mouseIndex)
 {
     //print(base.Availability(mouseIndex) + ", " + Mice.GetMouse(body.index).drySocialize(mouseIndex));
     if (mouseIndex == body.index)
     {
         return(MPRESPONSE.INACTIVE);
     }
     return(Mice.GetMouse(body.index).drySocialize(mouseIndex) ? base.Availability(mouseIndex) : MPRESPONSE.REJECTED);
 }
Beispiel #12
0
 protected override void OnEngage(Mice.Mouse mouse)
 {
     if (occupants.Contains(mouse.currMate))
     {
         if (mouse.female != Mice.GetMouse(mouse.currMate).female)
         {
             Mice.mice.CreateBaby(mother(mouse), father(mouse));
         }
     }
 }
Beispiel #13
0
        public void SexUpdate(int partner)
        {
            bool rule1 = pctChance(75 * (redShift + 0.5f));
            bool rule2 = DryHump(partner);
            bool rule3 = Mice.GetMouse(partner).DryHump(index);

            if (rule1 && rule2 && rule3)
            {
                InitSex(partner);
                Mice.GetMouse(partner).InitSex(index);
            }
        }
Beispiel #14
0
        public Mouse(int index, MicePreset.MousePreset preset)
        {
            this.index = index;
            GameObject q = Instantiate(Mice.mice.bodyPrefab);

            body              = q.GetComponent <MouseBody>();
            motiveMod         = preset.motiveMods;
            motives           = new Appetite[7];
            body.tform.parent = mice.transform;
            scale             = Mice.MiceScale(preset.age, preset.maxAge, preset.maxScale);
            maxScale          = preset.maxScale;
            age                = preset.age;
            rstep              = Mice.rstep;
            rtime              = 0;
            maxAge             = preset.maxAge;
            speed              = (preset.energyLevel / Mice.mice.energyLevelG) * Mice.mice.speedG;
            relationshipsView  = new List <int>();
            female             = preset.female;
            _relationships     = new float[200];
            motivesView        = new List <int>();
            protagRelationship = Mice.rmod * Mice.mice.baseProtagAffection;
            scale              = Mice.MiceScale(age + 0.1f, this.female ? Mice.mice.pubertyf : Mice.mice.pubertym, maxScale);
            for (int i = 0; i < relationships.Length; ++i)
            {
                relationships[i] = Mice.rmod * Mice.mice.baseMouseAffection;
            }
            redShift      = (preset.color.r / 255f) - 0.5f;
            greenShift    = (preset.color.g / 255f) - 0.5f;
            blueShift     = (preset.color.b / 255f) - 0.5f;
            affectionRate = Mice.mice.globalAffectionRate - Mice.mice.globalAffectionRate * blueShift;
            affinity      = new Vector3(preset.color.r, preset.color.g, preset.color.b);
            hiAffinity    = (int)Mathf.Max(affinity[0], Mathf.Max(affinity[1], affinity[2]));
            float hi = float.MinValue;

            for (int i = 0; i < 3; ++i)
            {
                if (affinity[i] > hi && i != hiAffinity)
                {
                    penHiAffinity = i;
                    hi            = affinity[i];
                }
            }
            body.SetupBody(scale, preset.color, index);
            goalPoint = MiceZone.zone.GetWanderPoint();
            motives[(int)MSTIMULUS.HUNGER]   = new AppHunger((int)MSTIMULUS.HUNGER, 0.5f, 0.3f, 0.7f, Mice.mice.hungerThreshold + 2 * greenShift, 10);
            motives[(int)MSTIMULUS.ENERGY]   = new AppEnergy((int)MSTIMULUS.ENERGY, 1f, 0.1f, 0.9f, Mice.mice.energyLevelG + (greenShift + redShift), 15);
            motives[(int)MSTIMULUS.SOCIAL]   = new AppSocial((int)MSTIMULUS.SOCIAL, 1f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * blueShift, 8);
            motives[(int)MSTIMULUS.SEXDRIVE] = new AppSex((int)MSTIMULUS.SEXDRIVE, 0.5f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * redShift, 9);
            motives[(int)MSTIMULUS.BATHROOM] = new AppBathroom((int)MSTIMULUS.BATHROOM, 1, 0.3f, 1, 1, 11);
            motives[(int)MSTIMULUS.BOREDOM]  = new AppBoredom((int)MSTIMULUS.BOREDOM, 0.5f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * redShift, 8);
            motives[(int)MSTIMULUS.CALL]     = new AppCall((int)MSTIMULUS.CALL, 1, 0.5f, 0.75f, 1, 100);
            body.emo.SetNotVisible();
        }
Beispiel #15
0
        public void CanCreateMice()
        {
            Mice momo = new Mice("momo", 4, "screech", 44, "black plague");

            Assert.Equal("momo", momo.Name);
            Assert.Equal(4, momo.Legs);
            Assert.Equal("screech", momo.UserSpeech());
            Assert.Equal(44, momo.RabiesLevel);
            Assert.True(momo.BiteSomeone());
            Assert.True(momo.Carnivore());
            Assert.Equal("Goodnight", momo.Sleep());
        }
Beispiel #16
0
 void Update()
 {
     InteractTarget.itar.target = Mice.GetMouse(i).body.tform.position;
     InteractTarget.itar.SetActive(true);
     txt.text = Mice.GetMouse(i).StatsString();
     if (Input.GetButtonDown("RB"))
     {
         i++;
         if (i >= Mice.population)
         {
             i = 0;
         }
     }
 }
 private void InputOnMouseAction(object sender, MousePressedEventArgs e)
 {
     e.DeviceId = DeviceMap[e.DeviceName].PersistantId;
     if (Mice.ContainsKey(e.DeviceId))
     {
         var inputTuple = Mice[e.DeviceId];
         if (!inputTuple.Natural)
         {
             inputTuple.PreMouseData  = inputTuple.LastMouseData;
             inputTuple.LastMouseData = e;
             OnVirtualMouseAction(e);
             e.Handled = true;
         }
     }
 }
Beispiel #18
0
 public void SetAttachPoint(Vector3 localPos, Transform parent, ProtagController protag)
 {
     rbody.isKinematic   = true;
     rbody.useGravity    = false;
     col.enabled         = false;
     tform.parent        = parent;
     tform.localPosition = localPos;
     if (mousePoint)
     {
         mousePoint.Deactivate();
     }
     if (mouseIndex > -1)
     {
         Mice.GetMouse(mouseIndex).SetHeld(true);
     }
 }
        public void Start()
        {
            Input = new Input
            {
                MouseFilterMode    = MouseFilterMode.All,
                KeyboardFilterMode = KeyboardFilterMode.All,
                FilterType         = FilterType.Whitelist
            };

            Input.SetKeyboardDeviceList(Keyboards.Where(e => !e.Value.Natural).Select(e => DeviceMap.FirstOrDefault(f => f.Value.PersistantId == e.Key).Value.MaybeRealId).ToArray());
            Input.SetMiceDeviceList(Mice.Where(e => !e.Value.Natural).Select(e => DeviceMap.FirstOrDefault(f => f.Value.PersistantId == e.Key).Value.MaybeRealId).ToArray());

            //Input.KeyboardFilterMode = KeyboardFilterMode.All;
            Input.OnMouseAction += InputOnMouseAction;
            Input.OnKeyPressed  += Input_OnKeyPressed;
            Input.Load();
        }
Beispiel #20
0
 public void allinactive()
 {
     Cat.SetActive(false);
     Cow.SetActive(false);
     Kancil.SetActive(false);
     Deer.SetActive(false);
     Bearblack.SetActive(false);
     Foxblack.SetActive(false);
     Frogblack.SetActive(false);
     Bear.SetActive(false);
     Fox.SetActive(false);
     Frog.SetActive(false);
     Mice.SetActive(false);
     Deer.SetActive(false);
     Catblack.SetActive(false);
     Miceblack.SetActive(false);
     Kancilblack.SetActive(false);
     Cowblack.SetActive(false);
     Deerblack.SetActive(false);;
 }
Beispiel #21
0
    public void DropKancil()
    {
        float Distance = Vector3.Distance(Kancil.transform.position, Kancilblack.transform.position);

        if (Distance < 50)
        {
            Kancil.transform.position = Kancilblack.transform.position;
            Mice.SetActive(true);
            clickSound.Play();
            ScoreDrag.totalscore += 20;
            Kancilb = false;
            check++;
            //level2++;
            // level3++;
        }
        else
        {
            Kancil.transform.position = KanciliniPost;
        }
    }
Beispiel #22
0
    void UpdateAsHost()
    {
        Vector3 world = GetMousePoint();

        // move mouse cursor object to that position
        thisMouse.transform.position = world;

        // keep track of my mouse position in the list of mice sent to guests
        miceTracker.Track(playerId, new Vec2d {
            X = world.x, Y = world.y
        });

        // get a list of only mice that have changed position
        Mice mice = miceTracker.BuildMice();

        if (mice != null)
        {
            // send changed mice to guests
            MiceChangeMessage mcm = new MiceChangeMessage
            {
                Payload = mice
            };
            stateFluxClient.SendRequest(mcm);

            // move mouse cursor gameobjects
            foreach (Mouse m in mice.Items)
            {
                SetPlayerMouseDetails(m);
            }
        }

        if (Input.GetMouseButtonDown(0))
        {
            if (stateFluxClient.isHosting)
            {
                SendHostFloobieCommand();
            }
            ChangeTracker changeTracker = CreateJake(world, thisPlayer.Color, circler);
            gameObjectTracker.TrackCreate(changeTracker);
        }
    }
    // Update is called once per frame
    void Update()
    {
        Vector2 screnMid    = new Vector2(Screen.width / 2, Screen.height / 2);
        Vector2 mouseOffset = Vector2.zero;

        if (overrideZoomAmount < 0)
        {
            mouseOffset = (Mice.screenMousePosition() - screnMid) / 400 * Player.Scale();
        }

        curPosition = Vector2.Lerp(curPosition, player.transform.position, Time.deltaTime * 4);

        transform.position = (Vector3)curPosition + (Vector3)mouseOffset + new Vector3(0, 0, -10);
        if (overrideZoomAmount < 0)
        {
            self.orthographicSize = Mathf.Lerp(self.orthographicSize, Mathf.Clamp(Player.Scale() * 5f, 0.35f, 100f), Time.deltaTime * 0.4f);
        }
        else
        {
            self.orthographicSize = Mathf.Lerp(self.orthographicSize, overrideZoomAmount, Time.deltaTime * 0.4f);
        }
    }
Beispiel #24
0
        public Mouse(int index, int father, int mother)
        {
            Mouse f = Mice.GetMouse(father);
            Mouse m = Mice.GetMouse(mother);

            this.father = father;
            this.mother = mother;
            motives     = new Appetite[7];
            this.index  = index;
            GameObject q = Instantiate(Mice.mice.bodyPrefab);

            body = q.GetComponent <MouseBody>();
            body.tform.parent = mice.transform;
            age      = 0;
            maxAge   = (m.maxAge + f.maxAge) / 2f;
            rstep    = Mice.rstep;
            rtime    = 0;
            maxScale = rbool ? m.maxScale : f.maxScale;
            female   = rbool;
            scale    = Mice.MiceScale(age + 0.1f, this.female ? Mice.mice.pubertyf : Mice.mice.pubertym, maxScale);
            Color fc  = f.body.body.material.color;
            Color mc  = m.body.body.material.color;
            float ccr = rbool ? fc.r : mc.r;
            float ccg = rbool ? fc.g : mc.g;
            float ccb = rbool ? fc.b : mc.b;
            Color cc  = new Color(ccr * Mice.rmod, ccg * Mice.rmod, ccb * Mice.rmod, 255);

            redShift   = ccr / 255f - 0.5f;
            greenShift = ccg / 255f - 0.5f;
            blueShift  = ccb / 255f - 0.5f;
            affinity   = new Vector3(cc.r, cc.g, cc.b);
            hiAffinity = (int)Mathf.Max(affinity[0], Mathf.Max(affinity[1], affinity[2]));
            float hi = float.MinValue;

            for (int i = 0; i < 3; ++i)
            {
                if (affinity[i] > hi && i != hiAffinity)
                {
                    penHiAffinity = i;
                    hi            = affinity[i];
                }
            }
            body.SetupBody(scale, cc, index);
            motivesView        = new List <int>();
            speed              = (rbool ? m.speed : f.speed) * (1 + 0.5f * redShift);
            relationshipsView  = new List <int>();
            motiveMod          = rbool ? m.motiveMod : f.motiveMod;
            _relationships     = new float[200];
            protagRelationship = Mice.rmod * Mice.mice.baseProtagAffection;
            for (int i = 0; i < relationships.Length; ++i)
            {
                relationships[i] = Mice.rmod * Mice.mice.baseMouseAffection;
            }
            relationships[father]            = 6f;
            relationships[mother]            = 6f;
            protagRelationship               = Mice.rmod * Mice.mice.baseProtagAffection;
            affectionRate                    = rbool ? f.affectionRate : m.affectionRate;
            goalPoint                        = MiceZone.zone.GetWanderPoint();
            motives[(int)MSTIMULUS.HUNGER]   = new AppHunger((int)MSTIMULUS.HUNGER, 0.5f, 0.3f, 0.7f, Mice.mice.hungerThreshold + 2 * greenShift, 10);
            motives[(int)MSTIMULUS.ENERGY]   = new AppEnergy((int)MSTIMULUS.ENERGY, 1f, 0.1f, 0.9f, Mice.mice.energyLevelG + (greenShift + redShift), 15);
            motives[(int)MSTIMULUS.SOCIAL]   = new AppSocial((int)MSTIMULUS.SOCIAL, 0.5f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * blueShift, 8);
            motives[(int)MSTIMULUS.SEXDRIVE] = new AppSex((int)MSTIMULUS.SEXDRIVE, 0.5f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * redShift, 9);
            motives[(int)MSTIMULUS.BATHROOM] = new AppBathroom((int)MSTIMULUS.BATHROOM, 0.9f, 0.3f, 1, 1, 11);
            motives[(int)MSTIMULUS.BOREDOM]  = new AppBoredom((int)MSTIMULUS.BOREDOM, 0.5f, 0.1f, 0.9f, Mice.mice.energyLevelG + 2 * redShift, 8);
            motives[(int)MSTIMULUS.CALL]     = new AppCall((int)MSTIMULUS.CALL, 1, 1, 1, 1, 100);
            body.emo.SetNotVisible();
        }
Beispiel #25
0
    // Update is called once per frame
    protected override void NVUpdate()
    {
        if (state == PROTAGSTATE.HOLD && _heldItem == -1)
        {
            state = PROTAGSTATE.NORMAL;
        }
        if (state == PROTAGSTATE.NORMAL && _heldItem > -1)
        {
            state = PROTAGSTATE.HOLD;
        }
        switch (state)
        {
        case PROTAGSTATE.NORMAL:
            YTYPE ystate = room == ILOC.HOUSE || room == ILOC.VOID ? YTYPE.SIT : YTYPE.CALL;

            ActionDisplay.yButton.SetState((int)ystate);
            LookForInteractive();
            if (targetInteractive)
            {
                adx = targetInteractive.xTYPE;
                adb = targetInteractive.bTYPE;
                if ((int)targetInteractive.bTYPE >= 0 && Input.GetButtonDown("B"))
                {
                    print("b");
                    float  f       = tform.position.y - targetInteractive.tform.position.y;
                    string trigger = f > 2 ? loPickupTrigger : (f < -2 ? hiPickupTrigger : midPickupTrigger);
                    if (targetInteractive.GetComponent <MouseBody>())
                    {
                        trigger = mousePickupTrigger;
                    }
                    FacePosition(tform.position);
                    anim.SetTrigger(trigger);
                    state = PROTAGSTATE.ANIMATION;
                }
                if ((int)targetInteractive.xTYPE >= 0 && Input.GetButtonDown("X"))
                {
                    print("x");
                    FacePosition(tform.position);
                    string trigger = xKey(targetInteractive.xTYPE);
                    if (trigger.Length > 0)
                    {
                        anim.SetTrigger(trigger);
                        state = PROTAGSTATE.ANIMATION;
                    }
                }
            }
            if (Input.GetButtonDown("Y"))
            {
                anim.SetTrigger(ystate == YTYPE.SIT ? sitTrigger : callTrigger);
                state = PROTAGSTATE.ANIMATION;
            }
            ActionDisplay.xButton.SetState((int)adx);
            ActionDisplay.bButton.SetState((int)adb);
            //check for interactives;

            /*Interactive[] iact = FindObjectsOfType<Interactive>();
             * float minDist = Mathf.Infinity;
             * int closest=-1;
             * for(int i = 0; i < iact.Length; ++i){
             *      float dist = Vector3.Distance(tform.position, iact[i].tform.position);
             *      if(dist < minDist){
             *              minDist = dist;
             *              closest = i;
             *      }
             * }
             * if(minDist<interactSphere && closest > -1){
             *      InteractTarget.itar.target =
             * }*/
            UpdateInventory();
            break;

        case PROTAGSTATE.HOLD:
            UpdateInventory();

            Vector3    dropPoint = tform.position - dropOffset * tform.forward;
            RaycastHit rae       = default(RaycastHit);
            if (Physics.Raycast(new Ray(dropPoint, Vector3.down), out rae))
            {
                dropPoint = rae.point;
            }
            InteractTarget.itar.target = dropPoint;
            //ActionDisplay.yButton.SetState((int)YTYPE.CALL);
            if (Items.GetItem(_heldItem).mouseIndex > -1)
            {
                //ActionDisplay.xButton.SetState(inventory[ins] == -1 ? (int)XTYPE.PET : (int)Items.GetItem(inventory[ins]).mouseAction);
                //ActionDisplay.yButton.SetState(DayCycle.dnc.sunday ? (int)YTYPE.MARK : -2);
                if (Input.GetButtonDown(xbtn))
                {
                    if (inventory[ins] > -1 && (int)Items.GetItem(inventory[ins]).mouseAction > -1)
                    {
                        Mice.GetMouse(Items.GetItem(_heldItem).mouseIndex).UseItemOn(inventory[ins]);
                        inventory[ins] = -1;
                    }
                    else
                    {
                        anim.SetTrigger(petTrigger);
                    }
                }
                if (Input.GetButtonDown(ybtn))
                {
                    Mice.GetMouse(Items.GetItem(_heldItem).mouseIndex).Mark();
                }
            }
            else
            {
            }
            if (Input.GetButtonDown(bbtn))
            {
                state = PROTAGSTATE.ANIMATION;
                anim.SetTrigger(dropTrigger);
            }

            break;

        case PROTAGSTATE.ANIMATION:
            rbody.velocity = Vector3.zero;
            break;

        case PROTAGSTATE.SIT:
            ActionDisplay.xButton.SetState(anim.GetBool(reachTrigger) ? (int)XTYPE.STORE : (int)XTYPE.REACH);
            ActionDisplay.yButton.SetState((int)YTYPE.STAND);
            if (Input.GetButtonDown("X"))
            {
                anim.SetBool(reachTrigger, !anim.GetBool(reachTrigger));
            }
            if (Input.GetButtonDown("Y"))
            {
                anim.SetTrigger(standTrigger);
                state = PROTAGSTATE.ANIMATION;
            }
            break;
        }
        if (state != PROTAGSTATE.SIT && state != PROTAGSTATE.ANIMATION)
        {
            float lsx = Input.GetAxis(lsticku);
            float lsy = Input.GetAxis(lstickv);
            if (Mathf.Abs(lsx) < 0.1f && Mathf.Abs(lsy) < 0.1f)
            {
                rbody.velocity = new Vector3(0, rbody.velocity.y, 0);
                anim.SetBool(moveAnim, false);
                anim.SetFloat(speedFloat, 0);
            }
            else
            {
                Vector3 dirc = lsx * SPCam.cam.tform.right + lsy * SPCam.cam.tform.forward;
                dirc.y = 0;
                float dirmag = new Vector2(lsx, lsy).magnitude;

                Vector3 dirf = Vector3.RotateTowards(-tform.forward, dirc, 1, acceleration * Time.deltaTime);
                tform.LookAt(tform.position - dirf);
                speed = Mathf.Lerp(speed, dirmag * speedMax, acceleration * Time.deltaTime);

                rbody.velocity = speed * dirf;
                anim.SetBool(moveAnim, true);
                anim.SetFloat(speedFloat, speed / speedMax);
            }
        }
    }
Beispiel #26
0
 protected override void OnDisengage(Mice.Mouse mouse)
 {
     Mice.GetMouse(body.index).DisengageMousePoint(true);
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            Grab();
        }

        if (Input.GetKeyUp(KeyCode.Mouse0))
        {
            UnGrab();
        }

        if (currentProp)
        {
            // currentProp.transform.localPosition = Vector3.MoveTowards(currentProp.transform.localPosition, Vector2.zero, Time.deltaTime);
            // currentProp.transform.localPosition = Vector3.MoveTowards(currentProp.transform.localPosition, lockPoint.InverseTransformPoint(currentProp.transform.TransformPoint(grabbedOffset)), Time.deltaTime);
        }

        if (Input.GetKey(KeyCode.Mouse1) || currentProp)
        {
            // armParent.eulerAngles = new Vector3(0, 0, Meth.pointToDegree(Mice.worldMousePosition(), armParent.position) + offset);
            armParent.eulerAngles = new Vector3(0, 0, Mathf.LerpAngle(armParent.eulerAngles.z, Meth.pointToDegree(Mice.worldMousePosition(), armParent.position) + offset, Time.deltaTime * 6f));
        }
        else
        {
            float targetAngle = (((player.xMoveInput * -40) - 90 + offset) % 360);
            armParent.eulerAngles = new Vector3(0, 0, Mathf.LerpAngle(armParent.eulerAngles.z, targetAngle, Time.deltaTime * 3));
        }

        // Time.timeScale = Mathf.MoveTowards(Time.time, currentProp && !player.onGround ? 0.8f : 1, Time.deltaTime * 3);
    }
Beispiel #28
0
 public override void Access(Mice.Mouse mouse)
 {
     mouse.IncreaseAffection(body.index, 1);
     Mice.GetMouse(body.index).SexUpdate(mouse.index);
 }
Beispiel #29
0
 void Awake()
 {
     instance = this;
 }
Beispiel #30
0
 public void NewDay()
 {
     age  += dayAging;
     scale = Mice.MiceScale(age + 0.1f, this.female ? Mice.mice.pubertyf : Mice.mice.pubertym, maxScale);
     print(index + ": feeding: " + dayFeeding + " exercise: " + dayExercise);
 }