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); }
public void stealDrive(Crewman crewman) { crewman.setActingType(Acting.NOTHING); if (crewman == GameManager.Instance.Sail.DriveCrew) { GameManager.Instance.Sail.DriveCrew = null; } }
public void crewmanWakeUpCount(Crewman crewman)//시간이 되면 깨우기 { if (crewman.gettime() == calendar.time) { crewman.setSleep(false); crewman.setActingType(Acting.NOTHING); } }
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); }
public bool crewDrive(Crewman crewman) { for (int i = 0; i < crewmanList.Count; i++) { if (crewmanList[i].getActingType() == Acting.DRIVE) { crewmanList[i].setActingType(Acting.NOTHING); } } crewman.setActingType(Acting.DRIVE); GameManager.Instance.Sail.DriveCrew = crewman; return(true); }
public bool crewmanFishingCount(Crewman crewman)//시간이 되면 낚시 그만두기 true면 그만 false면 계속 { if (crewman.gettime() == calendar.time) { crewman.setFishing(false); crewman.setActingType(Acting.NOTHING); if (crewmanFishingYes(crewman, GameManager.Instance.getNowFishingRod())) { GameManager.Instance.Food += 2; UIManager.Instance.showMessage("낚시 성공! \n식량 2를 획득하였습니다."); return(true); } else { UIManager.Instance.showMessage("낚시 실패!"); return(false); } } return(false); }