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
62 changes: 62 additions & 0 deletions migrations/2026/02/Version20260215175312.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Poppy Seed Pets API.
*
* The Poppy Seed Pets API is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* The Poppy Seed Pets API is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with The Poppy Seed Pets API. If not, see <https://www.gnu.org/licenses/>.
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260215175312 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// Forgotten Flowerpot
$this->addSql(<<<EOSQL
-- tool effect
INSERT INTO item_tool (`id`, `stealth`, `nature`, `brawl`, `arcana`, `crafts`, `grip_x`, `grip_y`, `grip_angle`, `grip_scale`, `fishing`, `gathering`, `music`, `smithing`, `science`, `grip_angle_fixed`, `focus_skill`, `provides_light`, `protection_from_heat`, `always_in_front`, `is_ranged`, `when_gather_id`, `when_gather_also_gather_id`, `climbing`, `leads_to_adventure`, `prevents_bugs`, `attracts_bugs`, `can_be_nibbled`, `increases_pooping`, `dreamcatcher`, `is_grayscaling`, `social_energy_modifier`, `sex_drive`, `when_gather_prevent_gather`, `adventure_description`, `when_gather_apply_status_effect`, `when_gather_apply_status_effect_duration`, `physics`, `electronics`, `hacking`, `umbra`, `magic_binding`, `mining`) VALUES (533,0,2,1,0,0,0.48,0.51,0,0.52,0,0,0,0,0,0,"nature",0,0,0,0,NULL,NULL,0,0,0,0,0,0,0,0,0,0,0,NULL,NULL,NULL,0,0,0,0,0,0) ON DUPLICATE KEY UPDATE `id` = `id`;

-- hat
INSERT INTO item_hat (`id`, `head_x`, `head_y`, `head_angle`, `head_scale`, `head_angle_fixed`) VALUES (314,0.49,0.89,0,0.55,0) ON DUPLICATE KEY UPDATE `id` = `id`;

-- the item itself!
INSERT INTO item (`id`, `name`, `description`, `image`, `use_actions`, `tool_id`, `food_id`, `fertilizer`, `plant_id`, `hat_id`, `fuel`, `recycle_value`, `enchants_id`, `spice_id`, `treasure_id`, `is_bug`, `hollow_earth_tile_card_id`, `cannot_be_thrown_out`, `museum_points`) VALUES (1512,"Forgotten Flowerpot",NULL,"hat/forgotten-flowerpot",NULL,533,NULL,20,NULL,314,0,0,NULL,NULL,NULL,0,NULL,0,1) ON DUPLICATE KEY UPDATE `id` = `id`;

-- grammar
INSERT INTO item_grammar (`id`, `item_id`, `article`) VALUES (1593,1512,"a") ON DUPLICATE KEY UPDATE `id` = `id`;

-- item groups
INSERT IGNORE INTO item_group_item (item_group_id, item_id) VALUES (34, 1512);
EOSQL);

// Duck Pond
$this->addSql(<<<EOSQL
-- hat
INSERT INTO item_hat (`id`, `head_x`, `head_y`, `head_angle`, `head_scale`, `head_angle_fixed`) VALUES (315,0.49,0.805,0,0.58,1) ON DUPLICATE KEY UPDATE `id` = `id`;

-- the item itself!
INSERT INTO item (`id`, `name`, `description`, `image`, `use_actions`, `tool_id`, `food_id`, `fertilizer`, `plant_id`, `hat_id`, `fuel`, `recycle_value`, `enchants_id`, `spice_id`, `treasure_id`, `is_bug`, `hollow_earth_tile_card_id`, `cannot_be_thrown_out`, `museum_points`) VALUES (1513,"Duck Pond",NULL,"hat/duckpond",NULL,NULL,NULL,0,NULL,315,60,0,NULL,NULL,NULL,0,NULL,0,1) ON DUPLICATE KEY UPDATE `id` = `id`;

-- grammar
INSERT INTO item_grammar (`id`, `item_id`, `article`) VALUES (1594,1513,"a") ON DUPLICATE KEY UPDATE `id` = `id`;
EOSQL);
}

public function down(Schema $schema): void
{
}
}
70 changes: 70 additions & 0 deletions migrations/2026/02/Version20260215224156.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);

/**
* This file is part of the Poppy Seed Pets API.
*
* The Poppy Seed Pets API is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
* The Poppy Seed Pets API is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with The Poppy Seed Pets API. If not, see <https://www.gnu.org/licenses/>.
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260215224156 extends AbstractMigration
{
public function getDescription(): string
{
return 'what is bird? who can say. this item group claims to be an authority, at any rate.';
}

public function up(Schema $schema): void
{
$this->addSql("INSERT INTO `item_group` (`id`, `name`, `is_craving`, `is_gift_shop`) VALUES (62, 'Bird Stuff', '0', '0') ON DUPLICATE KEY UPDATE id = id;");

$this->addSql(<<<EOSQL
INSERT INTO item_group_item (`item_group_id`, `item_id`)
SELECT 62 AS item_group_id, item.id AS item_id
FROM item
WHERE item.name IN (
'Bag of Feathers',
'Bird Bath Blueprint',
'Bird\'s-foot Trefoil',
'Black Feathers',
'Bleached Turkey Head',
'Century Egg',
'Crow\'s Eye',
'Duck Pond',
'Duck Sauce',
'Earth\'s Egg',
'Egg',
'Feathers',
'Fried Egg',
'Giant Turkey Leg',
'Goosecap',
'Green Egg',
'Imperturbable Toucan',
'Magpie Pouch',
'Magpie\'s Deal',
'Owl Trowel',
'Peacock Plushy',
'Phoenix Plushy',
'Tile: Thieving Magpie',
'Tile: Worm "Merchant"',
'Turkey King',
'Ruby Feather',
'White Feathers'
)
ON DUPLICATE KEY UPDATE `item_group_id` = `item_group_id`;
EOSQL);
}

public function down(Schema $schema): void
{
}
}
3 changes: 3 additions & 0 deletions src/Controller/Item/Pinata/Box/OpenNatureBoxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ public function openNatureBox(
$newInventory[$i]->setSpice($spice);
}

if($rng->rngNextInt(1, 8) === 8)
$newInventory[] = $inventoryService->receiveItem('Duck Pond', $user, $user, $user->getName() . ' got this from ' . $inventory->getItem()->getNameWithArticle() . '.', $location, $inventory->getLockedToOwner());

return BoxHelpers::countRemoveFlushAndRespond('Opening the box revealed', $userStatsRepository, $user, $inventory, $newInventory, $responseService, $em);
}
}
1 change: 0 additions & 1 deletion src/Controller/Item/Pinata/HatBoxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function openHatBox(
'Merchant\'s Cap',
'Merchant\'s Other Cap',
'Much Too Tall',
'Pizzaface',
'Propeller Beanie',
'Sombrero',
'Uncommon Blue',
Expand Down
16 changes: 11 additions & 5 deletions src/Controller/Item/Pinata/PizzaBoxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,22 @@ public function openPizzaBox(
->execute();

$numSlices = $rng->rngNextFromArray([
3, 3, 3, 3, 3, 4, 4, 4, 5, 6, // averages 3.8 (slightly less than 4, to avoid an infinite pizza box engine)
1, 3, 3, 3, 3, 4, 4, 4, 5, 6, // averages less than 4, to avoid an infinite pizza box engine
]);

for($i = 0; $i < $numSlices; $i++)
if($numSlices === 1)
$newInventory[] = $inventoryService->receiveItem('Pizzaface', $user, $user, $description, $location, $locked);
else
{
$newInventory[] = $inventoryService->receiveItem($rng->rngNextFromArray($possibleSlices), $user, $user, $description, $location, $locked)
->setSpice($inventory->getSpice())
;
for($i = 0; $i < $numSlices; $i++)
{
$newInventory[] = $inventoryService->receiveItem($rng->rngNextFromArray($possibleSlices), $user, $user, $description, $location, $locked)
->setSpice($inventory->getSpice())
;
}
}


return BoxHelpers::countRemoveFlushAndRespond('You open the box, finding', $userStatsRepository, $user, $inventory, $newInventory, $responseService, $em);
}

Expand Down
12 changes: 10 additions & 2 deletions src/Controller/Item/Scroll/FarmerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use App\Functions\UserQuestRepository;
use App\Service\Clock;
use App\Service\InventoryService;
use App\Service\IRandom;
use App\Service\ResponseService;
use App\Service\UserStatsService;
use Doctrine\ORM\EntityManagerInterface;
Expand All @@ -37,7 +38,7 @@ class FarmerController
public function invokeFarmerScroll(
Inventory $inventory, ResponseService $responseService, InventoryService $inventoryService,
UserStatsService $userStatsRepository, EntityManagerInterface $em, Clock $clock,
UserAccessor $userAccessor
UserAccessor $userAccessor, IRandom $rng
): JsonResponse
{
$user = $userAccessor->getUserOrThrow();
Expand Down Expand Up @@ -68,7 +69,14 @@ public function invokeFarmerScroll(
}

$items = [
'Straw Hat', $wheatOrCorn, 'Scythe', 'Creamy Milk', 'Egg', 'Grandparoot', 'Crooked Stick', 'Potato'
$rng->rngNextFromArray([ 'Straw Hat', 'Forgotten Flowerpot' ]),
$wheatOrCorn,
$rng->rngNextFromArray([ 'Scythe', 'Garden Shovel' ]),
$rng->rngNextFromArray([ 'Creamy Milk', 'Cheese', 'Plain Yogurt' ]),
'Egg',
$rng->rngNextFromArray([ 'Potato', 'Carrot', 'Beans', 'Onion' ]),
'Grandparoot',
'Crooked Stick'
];

$newInventory = [];
Expand Down
Loading