Exemplo n.º 1
0
    public bool crewmanFishing(Crewman crewman)//낚시하기
    {
        int time = -1;

        if (actingCheck(crewman))
        {
            stealDrive(crewman);

            if (crewman.getbehavior() >= 1)
            {
                if (GameManager.Instance.getNowFishingRod().Durability > 0)
                {
                    crewman.setFishing(true);
                    crewman.setActingType(Acting.FISHING);
                    crewman.setbehavior(crewman.getbehavior() - 1);

                    GameManager.Instance.getNowFishingRod().Durability -= 2;

                    time = calendar.time + 1;

                    if (time >= 24)
                    {
                        time -= 24;
                    }

                    crewman.settime(time);
                    return(true);
                }
                UIManager.Instance.showMessage("낚시대의 내구도가 부족합니다.");
            }
            UIManager.Instance.showMessage("행동력이 부족합니다.");
        }

        return(false);
    }
Exemplo n.º 2
0
    public bool crewmanSleep(Crewman crewman)//재우기
    {
        int behavior;
        int time = -1;

        if (actingCheck(crewman))
        {
            stealDrive(crewman);

            if (7 <= calendar.time && calendar.time < 19)
            {
                crewman.setSleep(true);
                crewman.setActingType(Acting.SLEEP);
                behavior = crewman.getbehavior() + 5;
                if (behavior > 10)
                {
                    behavior = 10;
                }
                crewman.setbehavior(behavior);
                time = calendar.time + 4;
                if (time >= 24)
                {
                    time -= 24;
                }
            }
            else
            {
                crewman.setSleep(true);
                crewman.setActingType(Acting.SLEEP);
                crewman.setbehavior(10);
                time = calendar.time + 6;
                if (time >= 24)
                {
                    time -= 24;
                }
            }
            crewman.settime(time);
            return(true);
        }
        return(false);
    }