"earth", "0010" => "unicorn", "0011" => "pegasus", "0100" => "alicorn", "0101" => "batpony", "0110" => "crystal", "0111" => "changeling", default => null, }; $species2 = match ($species2) { "0001" => "earth", "0010" => "unicorn", "0011" => "pegasus", "0100" => "alicorn", "0101" => "batpony", "0110" => "crystal", "0111" => "changeling", default => null, }; $alignment1 = match ($alignment1) { "0000" => "aroace", "0001" => "hetero", "0010" => "homo", "0011" => "bi", "0100" => "pan", default => null, }; $alignment2 = match ($alignment2) { "0000" => "aroace", "0001" => "hetero", "0010" => "homo", "0011" => "bi", "0100" => "pan", default => null, }; if ($little === 1) $little = 0; return [ 'shared_memory' => $sharedMemory, 'median' => false, 'protector' => $protector, 'fictive' => $fictive, 'little' => $little, 'not_talking' => false, 'host' => false, 'robot' => $robot, 'magic' => 0, 'sensitivity' => 0, 'food' => $food, 'plush' => $plush, 'nonverbal' => $nonverbal, 'less_frequent' => $lessFrequent, 'age_spells' => false, 'age_regressor' => false, 'leader' => $leader, 'persecutor' => $persecutor, 'sexually_active' => $sexuallyActive, 'polyamorous' => [ 'romantic' => $polyamorous1, 'sexual' => $polyamorous2 ], 'alignment' => [ 'romantic' => $alignment1, 'sexual' => $alignment2 ], 'species' => array_filter([ $species1, $species2 ], function ($i) { return isset($i); }) ]; } function parseMetadata ($metadata) { if (isset($metadata)) { if ($metadata["bitset"]) { $m = parseBitset($metadata["bitset"]); $m["marefriends"] = $metadata["marefriends"] ?? []; $m["bitset"] = $metadata["bitset"] ?? 0; $m["sisters"] = $metadata["sisters"] ?? []; $m["regression"] = $metadata["regression"] ?? null; $m["caretakers"] = $metadata["caretakers"] ?? []; $m["median"] = $metadata["median"] ?? null; $m["birth"] = $metadata["birth"] ?? null; $m["heat"] = $metadata["heat"] ?? null; $m["code"] = $metadata["code"] ?? null; } else { $m = $metadata; } return $m; } else { return $metadata; } }