|
1 | 1 | /datum/action/cooldown/spell |
2 | 2 | var/gain_desc |
3 | | - var/blood_used = 0 |
4 | 3 | var/vamp_req = FALSE |
5 | 4 |
|
6 | 5 | /datum/action/cooldown/spell/can_cast_spell(feedback = TRUE) |
7 | 6 | if(vamp_req) |
8 | 7 | if(!is_vampire(owner)) |
9 | 8 | return FALSE |
10 | | - var/datum/antagonist/vampire/V = owner.mind.has_antag_datum(/datum/antagonist/vampire) |
11 | | - if(!V) |
12 | | - return FALSE |
13 | | - if(V.usable_blood < blood_used) |
14 | | - if(feedback) |
15 | | - to_chat(owner, span_warning("You do not have enough blood to cast this!")) |
16 | | - return FALSE |
17 | 9 | return ..() |
18 | 10 |
|
19 | 11 | /datum/action/cooldown/spell/New() |
|
26 | 18 | // sanity check before we cast |
27 | 19 | if(!is_vampire(owner)) |
28 | 20 | return |
29 | | - |
30 | | - if(!blood_used) |
31 | | - return |
32 | | - |
33 | | - // enforce blood |
34 | | - var/datum/antagonist/vampire/vampire = owner.mind.has_antag_datum(/datum/antagonist/vampire) |
35 | | - |
36 | | - if(blood_used <= vampire.usable_blood) |
37 | | - vampire.usable_blood -= blood_used |
38 | | - |
39 | | - if(cast_on) |
40 | | - to_chat(owner, span_notice("<b>You have [vampire.usable_blood] left to use.</b>")) |
41 | | - |
42 | 21 | return ..() |
43 | 22 |
|
44 | 23 | /datum/action/cooldown/spell/is_valid_target(mob/living/target) |
|
84 | 63 |
|
85 | 64 | check_flags = NONE |
86 | 65 | cooldown_time = 20 SECONDS |
87 | | - blood_used = 20 |
| 66 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 20) |
88 | 67 | vamp_req = TRUE |
89 | 68 |
|
90 | 69 | /datum/action/cooldown/spell/rejuvenate/cast(mob/living/user) |
|
180 | 159 | school = SCHOOL_SANGUINE |
181 | 160 |
|
182 | 161 | cooldown_time = 30 SECONDS |
183 | | - blood_used = 20 |
| 162 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 20) |
184 | 163 | active_msg = span_warning("You prepare your hypnosis technique.") |
185 | 164 | deactive_msg = span_warning("You stop preparing your hypnosis.") |
186 | 165 | vamp_req = TRUE |
|
342 | 321 | school = SCHOOL_SANGUINE |
343 | 322 |
|
344 | 323 | aoe_radius = 4 |
345 | | - blood_used = 20 |
| 324 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 20) |
346 | 325 | vamp_req = TRUE |
347 | 326 |
|
348 | 327 | /datum/action/cooldown/spell/aoe/screech/get_things_to_cast_on(atom/center) |
|
389 | 368 |
|
390 | 369 | cooldown_time = 2 MINUTES |
391 | 370 | vamp_req = TRUE |
392 | | - blood_used = 30 |
| 371 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 30) |
393 | 372 | var/num_bats = 2 |
394 | 373 |
|
395 | 374 | /datum/action/cooldown/spell/bats/cast(mob/living/user) |
|
415 | 394 | background_icon_state = "bg_vampire" |
416 | 395 | overlay_icon_state = "bg_vampire_border" |
417 | 396 |
|
418 | | - blood_used = 30 |
| 397 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 30) |
419 | 398 | vamp_req = TRUE |
420 | 399 |
|
421 | 400 | /datum/action/cooldown/spell/pointed/vampirize |
|
430 | 409 |
|
431 | 410 | school = SCHOOL_SANGUINE |
432 | 411 |
|
433 | | - blood_used = 300 |
| 412 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 300) |
434 | 413 | vamp_req = TRUE |
435 | 414 |
|
436 | 415 | /datum/action/cooldown/spell/pointed/vampirize/InterceptClickOn(mob/living/user, params, atom/target_atom) |
|
443 | 422 | var/datum/antagonist/vampire/vamp = user.mind.has_antag_datum(/datum/antagonist/vampire) |
444 | 423 | if(is_vampire(target)) |
445 | 424 | to_chat(user, span_warning("They're already a vampire!")) |
446 | | - vamp.usable_blood += blood_used // Refund cost |
| 425 | + SEND_SIGNAL(user.mind, COMSIG_MIND_SPEND_ANTAG_RESOURCE, list(ANTAG_RESOURCE_VAMPIRE = -300)) // Refund cost |
447 | 426 | return FALSE |
448 | 427 | if(HAS_TRAIT(target, TRAIT_MINDSHIELD)) |
449 | 428 | to_chat(user, span_warning("[target]'s mind is too strong!")) |
450 | | - vamp.usable_blood += blood_used // Refund cost |
| 429 | + SEND_SIGNAL(user.mind, COMSIG_MIND_SPEND_ANTAG_RESOURCE, list(ANTAG_RESOURCE_VAMPIRE = -300)) // Refund cost |
451 | 430 | return FALSE |
452 | 431 | user.visible_message(span_warning("[user] latches onto [target]'s neck, pure dread eminating from them."), span_warning("You latch onto [target]'s neck, preparing to transfer your unholy blood to them."), span_warning("A dreadful feeling overcomes you")) |
453 | 432 | target.reagents.add_reagent(/datum/reagent/medicine/salbutamol, 10) //incase you're choking the victim |
|
464 | 443 | if(!do_after(user, 7 SECONDS, target)) |
465 | 444 | to_chat(user, span_danger("The pact has failed! [target] has not became a vampire.")) |
466 | 445 | to_chat(target, span_notice("The visions stop, and you relax.")) |
467 | | - vamp.usable_blood += blood_used // Refund the cost |
| 446 | + SEND_SIGNAL(user.mind, COMSIG_MIND_SPEND_ANTAG_RESOURCE, list(ANTAG_RESOURCE_VAMPIRE = -300)) // Refund cost |
468 | 447 | return FALSE |
469 | 448 | if(!QDELETED(user) && !QDELETED(target)) |
470 | 449 | to_chat(user, span_notice(". . .")) |
|
494 | 473 |
|
495 | 474 | school = SCHOOL_CONJURATION |
496 | 475 |
|
497 | | - blood_used = 100 |
| 476 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 100) |
498 | 477 | vamp_req = TRUE |
499 | 478 |
|
500 | 479 | /datum/action/cooldown/spell/summon_coat/cast(mob/living/user) |
|
525 | 504 | cooldown_time = 20 SECONDS |
526 | 505 | die_with_shapeshifted_form = FALSE |
527 | 506 | convert_damage_type = STAMINA |
528 | | - blood_used = 15 |
| 507 | + resource_costs = list(ANTAG_RESOURCE_VAMPIRE = 15) |
529 | 508 | vamp_req = TRUE |
530 | 509 | check_flags = AB_CHECK_CONSCIOUS | AB_CHECK_INCAPACITATED |
531 | 510 | possible_shapes = list(/mob/living/simple_animal/hostile/vampire_bat) |
532 | 511 |
|
533 | 512 | /datum/action/cooldown/spell/shapeshift/vampire/can_cast_spell() |
534 | 513 | if(ishuman(owner)) |
535 | | - blood_used = 15 |
| 514 | + bypass_cost = FALSE |
536 | 515 | else |
537 | | - blood_used = 0 |
| 516 | + bypass_cost = TRUE |
538 | 517 | return ..() |
0 commit comments