-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds a component for putting a mob in an object, utilizes it in pAI c…
…ode (#5700)
- Loading branch information
1 parent
07155e8
commit 062dd60
Showing
5 changed files
with
100 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/datum/component/object_transform | ||
var/obj/transformed_object | ||
var/to_object_text | ||
var/to_mob_text | ||
|
||
/datum/component/object_transform/Initialize(_transformed_object, _to_object_text, _to_mob_text) | ||
transformed_object = _transformed_object | ||
to_object_text = _to_object_text | ||
to_mob_text = _to_mob_text | ||
put_in_object(TRUE) | ||
|
||
/datum/component/object_transform/proc/swap_object(new_object) | ||
. = transformed_object | ||
var/mob/owner = parent | ||
if(parent in transformed_object.contents) | ||
owner.forceMove(transformed_object.loc) | ||
transformed_object = new_object | ||
put_in_object() | ||
|
||
/datum/component/object_transform/proc/put_in_object(silent = FALSE) | ||
var/mob/owner = parent | ||
transformed_object.forceMove(owner.loc) | ||
owner.forceMove(transformed_object) | ||
if(!silent && length(to_object_text)) | ||
owner.visible_message("<b>[owner]</b> [to_object_text]") | ||
|
||
/datum/component/object_transform/proc/put_in_mob(silent = FALSE) | ||
var/mob/owner = parent | ||
owner.forceMove(transformed_object.loc) | ||
transformed_object.forceMove(parent) | ||
if(!silent && length(to_mob_text)) | ||
owner.visible_message("<b>[owner]</b> [to_mob_text]") | ||
|
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