Skip to content

Commit

Permalink
V31
Browse files Browse the repository at this point in the history
* Update TR logic to have no softlocks

* allow csrf token

* Change to different way to mute audio that should work for even injected spc roms

* allow reverse

* upgrade deps

laravel 5.6 -> 5.7
many npm packages
some unit tests are failing right now, but will be corrected in a later
commit

* WIP

* WIP

* updating dependencies

* fix unit tests

* adding updates for sub releases

small fix for customizer and small keys and small typo

* Start of logic moving to flag based

* continuing consolidating logic

2 more regions
got static analysis below 400 issues
added more rom unit tests
created true random filler (not for production use)

* stan updates

down to under 100 errors on normal level

* More logic consolidation

* more unit tests around Rom class

* composer.json updates

* static analysis cleanup

* many more unit tests around rom.php

* whoops

* Cleaning up about 300 stan issues

* consolidated logic in 2 files

* Adding more unit tests to Rom class

* further work on static analysis fixes

* static analysis cleanup

* remaining static analysis

* fixes

* deps updates

* WIP

* Initial support for world bound items

* removed vanilla generation for simplification of code.

* let's not muddy memory

* Further multi-world prep adjustments

* playthrough is horked

* cleanup from master merge

* fix for customizer

* playthrough issue might be TenBombs fix for spoiler, might want to create a UncleBombs special item to deal with this.

* Change Randomizer to construct with an array of worlds

WIP

* WIP

the code is in a big mess, partially generates on multi-world. most
tests are failing.

* update unit tests to passing now

* better handling of fill for multiworld

I think it’s not rescanning worlds like I would hope so the fill might
be off, will verify later

* better vue showing of locations and items

* fix for filler to actually collect all items
* proper check of each worlds beatability
* switch to index 1 of first world

* small update for sprites and new ER

* Update composer.lock

* update to laravel 5.8

* update all js packages
* cleanup old unused packages from PHP
* update outdated PHP packages
* update tests to match new phpunit 8.x style

* further decoupling

* push global config into world specific configs
* remove old push patches to disk
* remove patch table in favor of just using seeds table
* remove dependency of ER on IR class
* update item randomizer controller to write all rom’s for multi-world
* randomizer no longer references rom class
* update tests

* WIP (frontend updates)

new UX, partially complete

* further work on new options layout

* code cleanup, and starting to move palette shuffle to front end

* code cleanup and features

* stubbed frontend new UI
* fixed multi-world different configs
* got palette shuffle into frontend

* get Palette shuffle working on front end

* Get customizer loading, but still needs a lot of localization work to load more efficiently

* add preset for beginner

* WIP

start of new pot shuffle front end code

* connect up all front end selects to backend config

* sort of fixed play-through for single world.
* need to hack rom for tower vs. ganon crystal requirement

* copy fix

* UI updates to make it cleaner

* small fixes to controller

* updates for bow and mushroom

* Update hint.txt

* Update hint.txt

Adding another on a friend's behalf.

* Update hint.txt

* A few good Blind puns, Ganon text, and Triforce text from the spoiler tournament

* Typo in Ether tablet item description

* Incorrect docstring and logic bug in canExtendMagic (sporchia#631)

* Incorrect docstring for canExtendMagic

* Fixed canExtendMagic

Changed canExtendMagic to check for Half Magic and Quarter Magic in the same statement, as opposed to multiplying them together, to account for that both can be in the item pool.

* Update Randomizer.php (sporchia#638)

* now allow 1 heart in customizer again

* add item placement and dungeon items

remove difficulty

* removed varation

goals cannot be counter intuitive

* entrance randomizer works again

* BK hint only when hints are enabled
* sprite names to i18n
* Retro is now a World type

* corrections

* fix hints as text
* added signs and text for ganon/tower requirements
* fix starting with sword bug
* fix credits bug
* progressive bow
* nearly got enemizer working (EN needs an update)

* package updates

remove properties from World for config's

* package updates

cleanup of some no longer needed front end code

* Futher front end cleanup

* small cleanups

* further updates

* work on Restricted/Advanced Item placement
* health moved to advancement
* skull woods key still sucks
* new has armor function

* cleanup

* removed unused functions from World
* updated packages
* consolidated TurtleRock logic
* initial draft of multiworld file format

* remove logic grouped initalize functions

in favor of of single function with flagged logic

* updates

* fix boss shuffle
* better non-100% fill alg
* item pool/functionality connected up
* dead config cleanup

* further cleanup

* package update

* options page updates

will need to look into all the translations

* fix to spoiler

don't show who's item when it's yours

* putting customizer on life support

* customizer updates

working better now, not perfect
added logic section

* options fixes from playtesting

* fixed bug with "Not Guaranteed" placement
* implemented single world 100% locations
* fixed bug with beginner preset

* Get Retro working again

* Added fast Ganon

* enemizer bosses fix

* shuffle bug
* customizer now has prizes as starting eq

* package updates

* fix for prizepacks

* also better dungeon shuffle boxes

* free item menu

* get ER workign with new options

* presets are part of rando settings api

* QS and ER adjustments

* fix permalinks

* fix for spoiler on meta

* rom update

* Fix for player NaN in spoiler

* fix shuffle in info

* get console command working again

* copy updates

* fix saving rom from permalink

* updates

initial front end unit tests
small fixes based on getting unit testing working

* updates per beta feedback

* fix standard vanilla swords

* fix customizer item pool and naming

* get daily working again

* ganon sign and bow in escape

* correct enemy health

* Handle progressive bow hint at ganon

* properly handle the bow hints

* rom updates

* bag o fixes for beta

* bosses are tied to world
* customizer spoiler issue
* customizer name collision
* swordless upgrade
* ad sizing issue

* static analysis fixes

* convert code to psr-12

this is entirely a style change

* further styling

* switch to prettier for js based files

* make customizing options more obvious

* dupe key issue and unnessary warnings

* fix item pool from customizer

* small updates

* rename dungeon shuffles
* rename restricted to basic
* update generate buttons

* Spoiler fixes

* GT preopened on 0 crystals

* fix ER shops in spoilers

* fix basic playthrough

* updates to basic itemPlacement per doc

* advanced itemPlacement updates

* better ganon sign texts

* small typo

* updates to meta

* no need to break here

* update to ER

* Most of crowd control put back

* prep for bow limit in rom

* hints and fix for dungeon counts

* correct waterwalk logic where it makes sense

* copy update

* turning in triforces reuiqres NW lightworld now

remove 50/70 upgrades from customizer

* update for triforce turn in

* fix extra sanc heart

* "Spoilers on Generate" API functionality (sporchia#10)

* adding 'generate on spoiler' API functionality

* fixed indentations
remove unneccessary condition in SendPatchToDisk
cleaned up and reduced repeated code in CustomizerController and RandomizerController
set default values for tournament, spoilers, and spoilers_ongen to be a boolean instead of a string

* style fixes

* fix seed number appearing in the meta for the entrance spoiler

* Update MakeTranslation.php

* update for triforce hunt

* assure it's enabled

* update rom for msu

* fix small error in hash endpoint

* sprite update 😄

* don't show bottle filled message

* package updates

* capture errors better

* fixes to customizer and no logic bug

* copy updates

changing enemy health and damage back to default when off.

* more copy updates

* whoops

* fixes

* rom update to fix MSU crashes

* strips daily of all spoiler data except meta (sporchia#11)

fixes bug where a weight for "basic" entrance shuffle was specified, but not "restricted"

* reports were these were backwards

* removing weird format

* Update sprites.php

* renaming sprites can be hard

* fix triforce dude text

* updated presets and updates page

* adds entry_crystals_ganon and entry_crystals_tower to spoiler meta for dailies customizer games, ensures the original crystals_ganon and crystals_tower values are removed from the meta for dailies (sporchia#12)

* fix for text boxes and prog bow limit

* update to prog bows

* Reconciling i18n translations (sporchia#13)

* reconciling i18n translation files

* get translated entrance shuffle options from entrance.php

* fix error.php for ES

* package updates

* stray comma

* handle starting capacities in customizer

* update logo

* partial update of copy

* more to come

* remaining copy updates

* Update vue-i18n-locales.generated.js

* Fixed count bug

* fixed typo

* fixed customizer file load bug

* fix small magic customizer bug
  • Loading branch information
sporchia committed Sep 14, 2019
1 parent 6f2edcd commit eaf738c
Show file tree
Hide file tree
Showing 522 changed files with 76,565 additions and 63,492 deletions.
13 changes: 0 additions & 13 deletions .env.dusk

This file was deleted.

19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
env: {
node: true,
browser: true,
es6: true,
"jest/globals": true
},
extends: ["eslint:recommended", "plugin:vue/essential"],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
ecmaVersion: 2018,
sourceType: "module"
},
plugins: ["jest", "vue"],
rules: {}
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
/storage/*.key
/resources/assets/js/*.generated.js
/vendor
/coverage
/docs
/report
/.idea
.env
.env.debug
.phpunit.result.cache
.php_cs.cache
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"workbench.colorCustomizations": {}
}
295 changes: 164 additions & 131 deletions app/Boss.php
Original file line number Diff line number Diff line change
@@ -1,151 +1,184 @@
<?php namespace ALttP;
<?php

namespace ALttP;

use ALttP\Item;
use ALttP\Support\BossCollection;
use ALttP\Support\ItemCollection;
use ALttP\Support\LocationCollection;

/**
* Boss Logic for beating each boss
*/
class Boss {
protected $name;
protected $enemizer_name;
protected $can_beat;

static protected $items;
class Boss
{
/** @var string */
protected $name;
/** @var string */
protected $enemizer_name;
/** @var callable|null */
protected $can_beat;
/** @var array */
protected static $items;
/** @var array */
protected static $worlds = [];

/**
* Get the Boss by name
*
* @param string $name Name of Boss
*
* @throws Exception if the Boss doesn't exist
*
* @return Boss
*/
static public function get(string $name) {
$items = static::all();
if (isset($items[$name])) {
return $items[$name];
}
/**
* Get the Boss by name
*
* @param string $name Name of Boss
* @param \ALttP\World $world World boss belongs to
*
* @throws \Exception if the Boss doesn't exist
*
* @return \ALttP\Boss
*/
public static function get(string $name, World $world): Boss
{
$items = static::all($world);
if (isset($items[$name])) {
return $items[$name];
}

throw new \Exception('Unknown Boss: ' . $name);
}
throw new \Exception('Unknown Boss: ' . $name);
}

/**
* Get the all known Bosses
*
* @return BossCollection
*/
static public function all() : BossCollection {
if (static::$items) {
return static::$items;
}
/**
* Clears the internal cache so we don't leak memory in testing.
*
* @return void
*/
public static function clearCache(): void
{
static::$items = [];
static::$worlds = [];
}

static::$items = new BossCollection([
new static("Armos Knights", "Armos", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->canShootArrows()
|| $items->has('Boomerang') || $items->has('RedBoomerang')
|| ($items->canExtendMagic(4) && ($items->has('FireRod') || $items->has('IceRod')))
|| ($items->canExtendMagic(2) && ($items->has('CaneOfByrna') || $items->has('CaneOfSomaria')));
}),
new static("Lanmolas", "Lanmola", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer')
|| $items->canShootArrows() || $items->has('FireRod') || $items->has('IceRod')
|| $items->has('CaneOfByrna') || $items->has('CaneOfSomaria');
}),
new static("Moldorm", "Moldorm", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer');
}),
new static("Agahnim", "Agahnim", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->has('BugCatchingNet');
}),
new static("Helmasaur King", "Helmasaur", function($locations, $items) {
return $items->hasSword() || $items->canShootArrows();
}),
new static("Arrghus", "Arrghus", function($locations, $items) {
return $items->has('Hookshot') && ($items->has('Hammer') || $items->hasSword()
|| (($items->canExtendMagic(2) || $items->canShootArrows()) && ($items->has('FireRod') || $items->has('IceRod'))));
}),
new static("Mothula", "Mothula", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer')
|| ($items->canExtendMagic(2) && ($items->has('FireRod') || $items->has('CaneOfSomaria')
|| $items->has('CaneOfByrna')))
|| $items->canGetGoodBee();
}),
new static("Blind", "Blind", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer')
|| $items->has('CaneOfSomaria') || $items->has('CaneOfByrna');
}),
new static("Kholdstare", "Kholdstare", function($locations, $items) {
return $items->canMeltThings() && ($items->has('Hammer') || $items->hasSword()
|| ($items->canExtendMagic(3) && $items->has('FireRod'))
|| ($items->canExtendMagic(2) && $items->has('FireRod') && $items->has('Bombos')));
}),
new static("Vitreous", "Vitreous", function($locations, $items) {
return $items->has('Hammer') || $items->hasSword() || $items->canShootArrows();
}),
new static("Trinexx", "Trinexx", function($locations, $items) {
return $items->has('FireRod') && $items->has('IceRod')
&& ($items->hasSword(3) || $items->has('Hammer')
|| ($items->canExtendMagic(2) && $items->hasSword(2))
|| ($items->canExtendMagic(4) && $items->hasSword()));
}),
new static("Agahnim2", "Agahnim2", function($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->has('BugCatchingNet');
}),
/**
* Get the all known Bosses
*
* @return \ALttP\Support\BossCollection
*/
public static function all(World $world): BossCollection
{
if (isset(static::$items[$world->id])) {
return static::$items[$world->id];
}
static::$worlds[$world->id] = $world;

]);
static::$items[$world->id] = new BossCollection([
new static("Armos Knights", "Armos", function ($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->canShootArrows()
|| $items->has('Boomerang') || $items->has('RedBoomerang')
|| ($items->canExtendMagic(4) && ($items->has('FireRod') || $items->has('IceRod')))
|| ($items->canExtendMagic(2) && ($items->has('CaneOfByrna') || $items->has('CaneOfSomaria')));
}),
new static("Lanmolas", "Lanmola", function ($locations, $items) {
return $items->hasSword() || $items->has('Hammer')
|| $items->canShootArrows() || $items->has('FireRod') || $items->has('IceRod')
|| $items->has('CaneOfByrna') || $items->has('CaneOfSomaria');
}),
new static("Moldorm", "Moldorm", function ($locations, $items) {
return $items->hasSword() || $items->has('Hammer');
}),
new static("Agahnim", "Agahnim", function ($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->has('BugCatchingNet');
}),
new static("Helmasaur King", "Helmasaur", function ($locations, $items) {
return ($items->canBombThings() || $items->has('Hammer'))
&& ($items->hasSword(2) || $items->canShootArrows());
}),
new static("Arrghus", "Arrghus", function ($locations, $items) use ($world) {
return ($world->config('itemPlacement') !== 'basic' || $world->config('mode.weapons') === 'swordless' || $items->hasSword(2))
&& $items->has('Hookshot') && ($items->has('Hammer') || $items->hasSword()
|| (($items->canExtendMagic(2) || $items->canShootArrows()) && ($items->has('FireRod') || $items->has('IceRod'))));
}),
new static("Mothula", "Mothula", function ($locations, $items) use ($world) {
return ($world->config('itemPlacement') !== 'basic' || $items->hasSword(2) || ($items->canExtendMagic(2) && $items->has('FireRod')))
&& ($items->hasSword() || $items->has('Hammer')
|| ($items->canExtendMagic(2) && ($items->has('FireRod') || $items->has('CaneOfSomaria')
|| $items->has('CaneOfByrna')))
|| $items->canGetGoodBee());
}),
new static("Blind", "Blind", function ($locations, $items) use ($world) {
return ($world->config('itemPlacement') !== 'basic' || $world->config('mode.weapons') === 'swordless' || ($items->hasSword() && ($items->has('Cape') || $items->has('CaneOfByrna'))))
&& ($items->hasSword() || $items->has('Hammer')
|| $items->has('CaneOfSomaria') || $items->has('CaneOfByrna'));
}),
new static("Kholdstare", "Kholdstare", function ($locations, $items) use ($world) {
return ($world->config('itemPlacement') !== 'basic' || $items->hasSword(2) || ($items->canExtendMagic(3) && $items->has('FireRod'))
|| ($items->has('Bombos') && ($world->config('mode.weapons') === 'swordless' || $items->hasSword()) && $items->canExtendMagic(2) && $items->has('FireRod')))
&& $items->canMeltThings($world) && ($items->has('Hammer') || $items->hasSword()
|| ($items->canExtendMagic(3) && $items->has('FireRod'))
|| ($items->canExtendMagic(2) && $items->has('FireRod') && $items->has('Bombos')));
}),
new static("Vitreous", "Vitreous", function ($locations, $items) use ($world) {
return ($world->config('itemPlacement') !== 'basic' || $items->hasSword(2) || $items->canShootArrows())
&& ($items->has('Hammer') || $items->hasSword() || $items->canShootArrows());
}),
new static("Trinexx", "Trinexx", function ($locations, $items) use ($world) {
return $items->has('FireRod') && $items->has('IceRod')
&& ($world->config('itemPlacement') !== 'basic' || $world->config('mode.weapons') === 'swordless' || $items->hasSword(3) || ($items->canExtendMagic(2) && $items->hasSword(2)))
&& ($items->hasSword(3) || $items->has('Hammer')
|| ($items->canExtendMagic(2) && $items->hasSword(2))
|| ($items->canExtendMagic(4) && $items->hasSword()));
}),
new static("Agahnim2", "Agahnim2", function ($locations, $items) {
return $items->hasSword() || $items->has('Hammer') || $items->has('BugCatchingNet');
}),
]);

return static::all();
}
return static::all($world);
}

/**
* Create a new Item
*
* @param string $name Unique name of Boss
* @param callable $can_beat Rules for beating the Boss
*
* @return void
*/
public function __construct(string $name, string $ename = null, callable $can_beat = null) {
$this->name = $name;
$this->enemizer_name = $ename ?? $name;
$this->can_beat = $can_beat;
}
/**
* Create a new Item.
*
* @param string $name Unique name of Boss
* @param callable|null $can_beat Rules for beating the Boss
*
* @return void
*/
public function __construct(string $name, string $ename = null, callable $can_beat = null)
{
$this->name = $name;
$this->enemizer_name = $ename ?? $name;
$this->can_beat = $can_beat;
}

/**
* Get the name of this Boss
*
* @return string
*/
public function getName() {
return $this->name;
}
/**
* Get the name of this Boss.
*
* @return string
*/
public function getName(): string
{
return $this->name;
}

/**
* Get the name of this Boss for Enemizer
*
* @return string
*/
public function getEName() {
return $this->enemizer_name;
}
/**
* Get the name of this Boss for Enemizer.
*
* @return string
*/
public function getEName(): string
{
return $this->enemizer_name;
}

/**
* Determine if Link can beat this Boss.
*
* @param ItemCollection $items Items Link can collect
* @param LocationCollection $locations
*
* @return bool
*/
public function canBeat($items, $locations = null) : bool {
if (!$this->can_beat || call_user_func($this->can_beat, $locations ?? new LocationCollection, $items)) {
return true;
}
/**
* Determine if Link can beat this Boss.
*
* @param \ALttP\Support\ItemCollection $items Items Link can collect
* @param \ALttP\Support\LocationCollection|null $locations
*
* @return bool
*/
public function canBeat(ItemCollection $items, ?LocationCollection $locations = null): bool
{
if ($this->can_beat === null || call_user_func($this->can_beat, $locations ?? new LocationCollection, $items)) {
return true;
}

return false;
}
return false;
}
}
21 changes: 12 additions & 9 deletions app/Build.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php namespace ALttP;
<?php

namespace ALttP;

use Illuminate\Database\Eloquent\Model;

class Build extends Model {
protected $fillable = [
'build',
'hash',
];
class Build extends Model
{
protected $fillable = [
'build',
'hash',
];

protected $attributes = [
'patch' => '[]',
];
protected $attributes = [
'patch' => '[]',
];
}
Loading

0 comments on commit eaf738c

Please sign in to comment.