BlueGit

blue-star tribegen

Files

tribegen / web / src / Events / HuntingEvent.php

HuntingEvent.php

farming
timfa Tim · pushed by timfa · 9 months ago
569cc974 History
HuntingEvent.php 997 B Download Raw
1<?php
2
3require_once __DIR__ . '/../../src/Events/Event.php';
4require_once __DIR__ . '/../../src/Classes/Kobold.php';
5
6class HuntingEvent extends Event
7{
8 public function getMinParticipants()
9 {
10 return 2;
11 }
12
13 public function getMaxParticipants()
14 {
15 return 5;
16 }
17
18 public function getCost()
19 {
20 return 25;
21 }
22
23 public function isAvailable()
24 {
25 return true;
26 }
27
28 public function execute()
29 {
30 $this->story = "The hunting party set out into the wilderness...\n\n";
31
32 $kobolds = $this->tribe->getAliveKobolds();
33
34 if (empty($kobolds)) {
35 $this->story .= "But there were no kobolds to hunt!";
36 return;
37 }
38
39 // TODO: Implement hunting logic
40 // This should use the kobold stats to determine success
41 // Can kill or injure kobolds, find items, etc.
42
43 $this->story .= "The hunters returned with valuable supplies.";
44
45 return $this->story;
46 }
47}