-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Сегвеи на станции #157
base: master
Are you sure you want to change the base?
Сегвеи на станции #157
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -908,3 +908,12 @@ | |
materials = list(MAT_METAL=500) | ||
construction_time = 50 | ||
category = list("Misc") | ||
|
||
/datum/design/segway_common | ||
name = "Segway" | ||
id = "segway_common" | ||
build_type = MECHFAB | ||
build_path =/obj/vehicle/segway | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (!)Куда-то пропавший пробел. |
||
materials = list(MAT_METAL=35000, MAT_GLASS=2500) | ||
construction_time = 80 | ||
category = list("Misc") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/obj/vehicle/segway | ||
name = "segway" | ||
desc = "two-wheeled vehicle of fashion, WOAH!" | ||
icon_state = "segway" | ||
dir = SOUTH | ||
|
||
load_item_visible = 1 | ||
mob_offset_y = 5 | ||
health = 100 | ||
maxhealth = 100 | ||
on = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on может получать значения, отличные от 1 и 0? Если нет, то почему это не оформлено под булевую переменную? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Потому что так решили кодеры прошлого, вооот. Не хочется в код шпессбайков лезть |
||
can_pull = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Читать комментарий выше. |
||
anchored = 0 | ||
Hakasolo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
layer = MOB_LAYER + 2 | ||
Hakasolo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
airlock_automatic_opening = 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Булевая переменная маскирующаяся под целочисленное. |
||
|
||
fire_dam_coeff = 0.75 | ||
brute_dam_coeff = 0.65 | ||
var/protection_percent = 60 | ||
|
||
var/land_speed = 1.5 | ||
var/space_speed = 0 | ||
|
||
var/step_energy_drain = 5 | ||
var/obj/item/weapon/stock_parts/cell/powercell = null | ||
|
||
/obj/vehicle/segway/load(mob/living/M) | ||
if(!istype(M)) | ||
return FALSE | ||
if(M.buckled || M.incapacitated() || M.lying || !Adjacent(M) || !M.Adjacent(src)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А возможно ли что моб впритык к сегвею, а сегвей к мобу - нет? |
||
return FALSE | ||
. = ..() | ||
if( . ) | ||
M.layer = layer - 0.9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Может конфликтовать. |
||
return | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ого это выход из функции в конце функции? |
||
|
||
/obj/vehicle/segway/MouseDrop_T(mob/living/M, mob/living/user) | ||
if(!istype(user, /mob/living/carbon/human) || !istype(M, /mob/living/carbon/human)) | ||
return | ||
if(isessence(user)) | ||
return | ||
if(user.incapacitated() || user.lying) | ||
return | ||
if(!load(M)) | ||
to_chat(user, "<span class='warning'>You were unable to load \the [M] onto \the [src].</span>") | ||
return | ||
|
||
/obj/vehicle/segway/atom_init() | ||
. = ..() | ||
overlays += image('icons/obj/vehicles.dmi', "[icon_state]_overlay", MOB_LAYER + 1) | ||
turn_off() | ||
|
||
/obj/vehicle/segway/relaymove(mob/user, direction) | ||
if(user.stat || user.stunned || user.weakened || user.paralysis) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. user.incapacitated() anyone? |
||
unload(user) | ||
return | ||
if(open || !(powercell && powercell.charge >= step_energy_drain)) | ||
return | ||
|
||
. = Move(get_step(src, direction)) | ||
if(.) | ||
powercell.charge = max(0, powercell.charge - step_energy_drain) | ||
user.dir = dir | ||
|
||
/obj/vehicle/segway/Move(var/turf/destination) | ||
if(istype(destination,/turf/space)) | ||
if(!space_speed) | ||
return 0 | ||
move_delay = space_speed + slow_cooef | ||
else | ||
if(!land_speed) | ||
return 0 | ||
move_delay = land_speed + slow_cooef | ||
return ..() | ||
|
||
/obj/vehicle/segway/attack_hand(mob/user) | ||
if(!load) | ||
return | ||
user.SetNextMove(CLICK_CD_MELEE) | ||
if(load != user) | ||
if(do_after(user, 20, target=src)) | ||
load.visible_message(\ | ||
"<span class='notice'>[load.name] was unbuckled by [user.name]!</span>",\ | ||
"<span class='warning'>You were unbuckled from [src] by [user.name].</span>",\ | ||
"<span class='notice'>You hear metal clanking.</span>") | ||
unload(load) | ||
else | ||
load.visible_message(\ | ||
"<span class='notice'>[load.name] unbuckled \himself!</span>",\ | ||
"<span class='notice'>You unbuckle yourself from [src].</span>",\ | ||
"<span class='notice'>You hear metal clanking.</span>") | ||
unload(load) | ||
|
||
/obj/vehicle/segway/attackby(obj/item/weapon/W, mob/user) | ||
if(istype(W, /obj/item/weapon/stock_parts/cell) && !powercell && open) | ||
user.drop_item() | ||
W.forceMove(src) | ||
powercell = W | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Я пока не нашёл дестрой прока который бы чистил ссылку, и удалял саму батарейку по ссылке. |
||
user.visible_message("[user] inserts a cell into the [name].", "You insert a cell into the [name].") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. А почему бы не писать полное название батарейки? А то вдруг это какая-то кастомная супер блюспейс батарейка. |
||
turn_on() | ||
return | ||
if(istype(W, /obj/item/weapon/crowbar)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. else if. |
||
if(open && powercell) | ||
powercell.forceMove(loc) | ||
powercell = null | ||
user.visible_message("[user] removes the cell from the [name].", "You remove the cell from the [name].") | ||
turn_off() | ||
return | ||
return ..() | ||
|
||
/obj/vehicle/segway/examine(mob/user) | ||
..() | ||
to_chat(user, " [open ? "Maintenance panel is open. " : "Maintenance panel is closed. "] [ open && !powercell ? "Powercell is missing. " : "" ]") | ||
|
||
/obj/vehicle/segway/turn_on() | ||
light_power = 3 | ||
return ..() | ||
|
||
/obj/vehicle/segway/turn_off() | ||
light_power = 0 | ||
..() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src. здесь может быть чутка лишним.