Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions scripts/ArtifactStruct/ArtifactStruct.gml
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,28 @@ function ArtifactStruct(_type_name = "", _tags = [], _identification_timer = 0,
};

/// @desc Destroys the artifact. Daemonic artifacts destroyed while on a ship may trigger a demon summoning battle.
/// @returns {Undefined}
static destroy_artifact = function() {
if (has_tag("daemonic")) {
var _resolved = __resolve_location();
if (_resolved.ship_id > -1) {
var demonSummonChance = roll_dice_chapter(1, 100, "high");

if ((demonSummonChance <= DEMON_SUMMON_THRESHOLD) && (obj_ini.ship_carrying[_resolved.ship_id] > 0)) {
instance_deactivate_all_safe();
instance_activate_object(obj_star);

/// @type {Asset.GMObject.obj_ncombat}
var _combat = instance_create_depth(0, 0, 0, obj_ncombat);
_combat.battle_special = "ship_demon";
_combat.formation_set = 1;
_combat.enemy = DEMON_SUMMON_ENEMIES;
_combat.battle_id = _resolved.ship_id;

instance_deactivate_object(obj_star);
setup_battle_formations();
scr_ship_battle(_resolved.ship_id, 999);
main_map_defaults();
}
}
}
Expand Down
38 changes: 13 additions & 25 deletions scripts/scr_ship_battle/scr_ship_battle.gml
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
/// @desc Builds the player roster for a boarding battle aboard the target ship.
/// @param {Real} target_ship_id Index into obj_ini.ship of the ship the battle is fought over.
/// @param {Real} cooridor_width Second ship index whose occupants also count as present.
/// @returns {Undefined}
function scr_ship_battle(target_ship_id, cooridor_width) {
// determine occupants
// determine who is fighting
// set maximum attacks due to hallway?
// set battle special

// if (argument2=true){
var co, v, stop, okay, sofar, _unit;
co = 0;
v = 0;
stop = 0;
okay = 0;
sofar = 0;

repeat (3600) {
if (co < 11) {
v += 1;
okay = 0;

if (v > 300) {
co += 1;
v = 1;
}
var sofar = 0;
Comment thread
The-Real-Nyx marked this conversation as resolved.

if (co > 10) {
stop = 1;
}
for (var co = 0; co < array_length(obj_ini.TTRPG); co++) {
var _company_length = company_length(co);

if (stop == 0) {
_unit = fetch_unit([co, v]);
if (!is_struct(_unit)) {
continue;
}
for (var v = 0; v < _company_length; v++) {
var okay = 0;
Comment thread
The-Real-Nyx marked this conversation as resolved.
var _unit = fetch_unit([co, v]);
if (!is_struct(_unit)) {
continue;
}
if ((_unit.ship_location == target_ship_id) && _unit.hp()) {
okay = 1;
}
Expand Down Expand Up @@ -213,7 +202,6 @@ function scr_ship_battle(target_ship_id, cooridor_width) {
targ = instance_nearest(col * 10, 240, obj_pnunit);
with (targ) {
scr_add_unit_to_roster(_unit);
}
}
}
}
Expand Down
Loading