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 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 crewmanRepair(Crewman crewman)// 수리하기 { if (actingCheck(crewman)) { if (crewman.gettype() == 1) { if (crewman.getbehavior() >= 2) { crewman.setbehavior(crewman.getbehavior() - 2); return(true); } } else if (crewman.getbehavior() >= 3) { crewman.setbehavior(crewman.getbehavior() - 3); return(true); } UIManager.Instance.showMessage("행동력이 부족합니다."); } return(false); }
private void checkKeyInput() { //crew에 선원 할당식 if ((driveCrew != null)) { if (Input.GetKeyDown(KeyCode.A) && (driveCrew.getbehavior() > 0)) { if (isControl == true) { isControl = false; isRight = false; originalDegree = shipDegree; driveCrew.setbehavior(driveCrew.getbehavior() - 1); } } if (Input.GetKey(KeyCode.A)) { if ((isControl == false) && (isRight == false)) { if (shipDegree < originalDegree) { shipDegree += 360; } if ((shipDegree - originalDegree) % 360 < limitAngle) { shipDegree += sailControlSpeed; shipModel.transform.rotation = Quaternion.Euler(0, 0, shipDegree); } else { } } } if (Input.GetKeyUp(KeyCode.A)) { if ((isControl == false) && (isRight == false)) { shipDegree = shipDegree % 360; isControl = true; } } if (Input.GetKeyDown(KeyCode.D) && (driveCrew.getbehavior() > 0)) { if (isControl == true) { isControl = false; isRight = true; originalDegree = shipDegree; driveCrew.setbehavior(driveCrew.getbehavior() - 1); } } if (Input.GetKey(KeyCode.D)) { if ((isControl == false) && (isRight == true)) { if (originalDegree < shipDegree) { originalDegree += 360; } if ((originalDegree - shipDegree) % 360 < limitAngle) { shipDegree -= sailControlSpeed; shipModel.transform.rotation = Quaternion.Euler(0, 0, shipDegree); } else { } } } if (Input.GetKeyUp(KeyCode.D)) { if ((isControl == false) && (isRight == true)) { shipDegree = shipDegree % 360; isControl = true; } } if (Input.GetKeyDown(KeyCode.Space) && (driveCrew.getbehavior() >= 2)) { if (isSailDown == false) { sailDown(); } else { sailUp(); } } } }