Changed Mob Hunt Server to be an abstract controller

Adds catch modifier support, track wild captures

Adds support for capture modifiers:
- These modifiers adjust the "effective run chance" of the mob,
potentially making it easier or harder to capture a mob based on the
total modifier
- Attempting to capture a mob in melee (running up and smacking it with
pda in hand) now grants a 20% capture bonus (reduces mob's effective run
chance by 20)
- Attempting to capture a mob at range (throwing the pda) does not grant
a bonus
- Support is in place for a client-based catch modifiers, to allow for
possible things such as bonuses or penalties from things like "item
cards" or achieving X number of captures. This is not currently planned
for this PR

Adds tracking of how many wild mobs you have captured to the game UI.
Mobs from trading cards will not increase this value, only mob you
captured from the wild will.
- Bragging rights for now, but could be used for a future "milestone"
system to earn bonuses

More cleanup and fixes

Thrown PDAs now properly trigger capture attempts

Mobs now properly consider their type preferences for spawning (may need
to up whitelist bonus weight)

Mobs no longer will spawn in holodeck areas, since this results in them
sometimes spawning on z2 in the holodeck source "templates"

show_message replaced with audible_message

Spawn area selection cleanup

Mobs will no longer attempt to spawn in the derelict solars,
constructionsite solars, or the unused /area/construction subtypes (the
base type is used, just not the subtypes as far as I can tell)
- Mobs will also avoid spawning on turfs that are not on the station
z-level, in the event an area is mistakenly mapped onto additional
z-levels or something
This commit is contained in:
FalseIncarnate
2016-09-08 12:44:26 -04:00
parent 89fe9a7e81
commit 6c4bce1eac
6 changed files with 66 additions and 51 deletions
+14 -5
View File
@@ -15,6 +15,8 @@
var/current_index = 0
var/connected = 0
var/hacked = 0 //if set, this cartridge is able to spawn trap mobs from its collection (set via emag_act on the cartridge)
var/catch_mod = 0 //used to adjust the likelihood of a mob running from this client, a negative value means it is less likely to run (support for temporary bonuses)
var/wild_captures = 0 //used to track the total number of mobs captured from the wild (does not count card mobs) by this client
/datum/data/pda/app/mob_hunter_game/start()
..()
@@ -42,8 +44,7 @@
mob_hunt_server.connected_clients += src
connected = 1
if(pda)
for(var/mob/O in hearers(2, pda.loc))
O.show_message("[bicon(pda)] Connection established. Capture all of the mobs, [pda.owner ? pda.owner : "hunter"]!")
pda.audible_message("[bicon(pda)] Connection established. Capture all of the mobs, [pda.owner ? pda.owner : "hunter"]!", null, 2)
return 1
/datum/data/pda/app/mob_hunter_game/proc/disconnect(reason = null)
@@ -53,18 +54,25 @@
connected = 0
//show a disconnect message if we were disconnected involuntarily (reason argument provided)
if(pda && reason)
for(var/mob/O in hearers(2, pda.loc))
O.show_message("[bicon(pda)] Disconnected from server. Reason: [reason].")
pda.audible_message("[bicon(pda)] Disconnected from server. Reason: [reason].", null, 2)
/datum/data/pda/app/mob_hunter_game/program_process()
if(!mob_hunt_server || !connected)
return
scan_nearby()
/datum/data/pda/app/mob_hunter_game/proc/register_capture(datum/mob_hunt/captured)
/datum/data/pda/app/mob_hunter_game/program_hit_check()
if(!pda)
return
for(var/obj/effect/nanomob/hit_mob in get_turf(pda))
hit_mob.hitby(pda)
/datum/data/pda/app/mob_hunter_game/proc/register_capture(datum/mob_hunt/captured, wild = 0)
if(!captured)
return 0
my_collection.Add(captured)
if(wild)
wild_captures++
return 1
/datum/data/pda/app/mob_hunter_game/update_ui(mob/user as mob, list/data)
@@ -72,6 +80,7 @@
data["connected"] = 0
else
data["connected"] = 1
data["wild_captures"] = wild_captures
data["no_collection"] = 0
if(!my_collection.len)
data["no_collection"] = 1