matilda002 / FollowTheLight

1 stars 0 forks source link

VER 2: update player path #64

Open lwcsharp opened 7 months ago

lwcsharp commented 7 months ago

-- Advance story by following the chosen player path update players set hp= hp - (select effect from player_paths where choice = 'CONTINUE' and username = 'test'), storypoint_id = (select to_point from player_paths where choice = 'CONTINUE' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'CONTINUE' and username = 'test') ;

-- post /story/players/test-2 -d "CONTINUE" curl -X POST update players set hp= hp - (select effect from player_paths where choice = $2 and username = $1), storypoint_id = (select to_point from player_paths where choice = 'CONTINUE' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'CONTINUE' and username = 'test');

lwcsharp commented 7 months ago

-- post /story/players/test-2 -d "A" update players set hp= hp + (select effect from player_paths where choice = 'A' and username = 'test'), storypoint_id = (select to_point from player_paths where choice = 'A' and username = 'test') where username = 'test' returning (select content from player_paths where choice = 'A' and username = 'test');