This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unlockable Flock Structures! Also Endgame! (#63)
* tah-dah * also relays get unlocked at 1000 compute * added a break statement on finding the wanted structure * we do a little coding * achievements and cheats * Update code/datums/abilities/flock/flockmind.dm Co-authored-by: stonepillars <65367576+stonepillars@users.noreply.github.com> * added friendly name to the unlockable structure datum, instead of calling initial() * whoops Co-authored-by: stonepillars <65367576+stonepillars@users.noreply.github.com>
- Loading branch information
1 parent
8c7c291
commit 666f821
Showing
9 changed files
with
111 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
ABSTRACT_TYPE(/datum/unlockable_flock_structure) | ||
/** | ||
* Subclass this for every new building type you add | ||
* Override the check_unlocked() function to do whatever unlock logic you have | ||
* If you're looking for a specific event, I recommend /datum/flock.achievements | ||
*/ | ||
/datum/unlockable_flock_structure | ||
var/structType = null | ||
var/datum/flock/my_flock = null | ||
var/unlocked = FALSE | ||
var/friendly_name | ||
|
||
New(var/datum/flock/F) | ||
..() | ||
if(F) | ||
src.my_flock = F | ||
var/obj/flock_structure/sT = src.structType //this is a gross hack, but needed for resolving flock_id | ||
friendly_name = initial(sT.flock_id) | ||
|
||
proc/process() | ||
if(src.check_unlocked()) | ||
if(!src.unlocked) | ||
src.my_flock.notifyUnlockStructure(src) | ||
src.unlocked = TRUE | ||
else if(src.unlocked) | ||
src.my_flock.notifyRelockStructure(src) | ||
src.unlocked = FALSE | ||
|
||
///Returns true when unlock condition is met, false when it isn't. | ||
proc/check_unlocked() | ||
return FALSE | ||
|
||
/datum/unlockable_flock_structure/relay | ||
structType = /obj/flock_structure/relay | ||
|
||
check_unlocked() | ||
return src.my_flock.total_compute() > 1000 | ||
|
||
/datum/unlockable_flock_structure/collector | ||
structType = /obj/flock_structure/collector | ||
|
||
check_unlocked() | ||
return TRUE | ||
|
||
/datum/unlockable_flock_structure/sentinel | ||
structType = /obj/flock_structure/sentinel | ||
|
||
check_unlocked() | ||
return TRUE | ||
|
||
/datum/unlockable_flock_structure/compute | ||
structType = /obj/flock_structure/compute | ||
|
||
check_unlocked() | ||
return src.my_flock.hasAchieved("cheatmode") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters