1
0
mirror of https://github.com/shiroikitsu8/Bayshore_6r_legacy.git synced 2024-11-28 09:20:54 +01:00

Merge pull request #30 from ghkkk090/master

fix ghost stuff again
This commit is contained in:
Luna 2022-08-19 14:14:01 +01:00 committed by GitHub
commit eec96bd011
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 705 additions and 594 deletions

View File

@ -422,10 +422,15 @@ export default class GameModule extends Module {
ghostOpponentCar!.manufacturer = 12; ghostOpponentCar!.manufacturer = 12;
ghostOpponentCar!.model = 105; ghostOpponentCar!.model = 105;
ghostOpponentCar!.visualModel = 130; ghostOpponentCar!.visualModel = 130;
ghostOpponentCar!.regionId = 18;
ghostOpponentCar!.country = 'GLB';
} }
if(ghostOpponentCar!.regionId === 0)
{
let randomRegionId = Math.floor(Math.random() * 47) + 1; let randomRegionId = Math.floor(Math.random() * 47) + 1;
ghostOpponentCar!.regionId = randomRegionId; ghostOpponentCar!.regionId = randomRegionId;
}
// Get Opponent 1 tune // Get Opponent 1 tune
ghostOpponentCar!.tunePower = ghostHistoryData![i].opponent1TunePower!; ghostOpponentCar!.tunePower = ghostHistoryData![i].opponent1TunePower!;
@ -460,10 +465,15 @@ export default class GameModule extends Module {
ghostOpponentCar2!.manufacturer = 12; ghostOpponentCar2!.manufacturer = 12;
ghostOpponentCar2!.model = 105; ghostOpponentCar2!.model = 105;
ghostOpponentCar2!.visualModel = 130; ghostOpponentCar2!.visualModel = 130;
ghostOpponentCar2!.regionId = 18;
ghostOpponentCar2!.country = 'GLB';
} }
if(ghostOpponentCar!.regionId === 0)
{
let randomRegionId = Math.floor(Math.random() * 47) + 1; let randomRegionId = Math.floor(Math.random() * 47) + 1;
ghostOpponentCar2!.regionId = randomRegionId; ghostOpponentCar2!.regionId = randomRegionId;
}
// Get Opponent 2 tune // Get Opponent 2 tune
ghostOpponentCar2!.tunePower = ghostHistoryData![i].opponent2TunePower!; ghostOpponentCar2!.tunePower = ghostHistoryData![i].opponent2TunePower!;
@ -495,10 +505,15 @@ export default class GameModule extends Module {
ghostOpponentCar3!.manufacturer = 12; ghostOpponentCar3!.manufacturer = 12;
ghostOpponentCar3!.model = 105; ghostOpponentCar3!.model = 105;
ghostOpponentCar3!.visualModel = 130; ghostOpponentCar3!.visualModel = 130;
ghostOpponentCar3!.regionId = 18;
ghostOpponentCar3!.country = 'GLB';
} }
if(ghostOpponentCar!.regionId === 0)
{
let randomRegionId = Math.floor(Math.random() * 47) + 1; let randomRegionId = Math.floor(Math.random() * 47) + 1;
ghostOpponentCar3!.regionId = randomRegionId; ghostOpponentCar3!.regionId = randomRegionId;
}
// Get Opponent 3 tune // Get Opponent 3 tune
ghostOpponentCar3!.tunePower = ghostHistoryData![i].opponent3TunePower!; ghostOpponentCar3!.tunePower = ghostHistoryData![i].opponent3TunePower!;

View File

@ -241,6 +241,7 @@ export default class GhostModule extends Module {
if(checkOneParticipant) if(checkOneParticipant)
{ {
let itemId = 0; let itemId = 0;
// 16th - C1 // 16th - C1
if(ocmEventDate.competitionId === 1) if(ocmEventDate.competitionId === 1)
{ {
@ -286,6 +287,66 @@ export default class GhostModule extends Module {
{ {
itemId = 47; itemId = 47;
} }
// 1st - C1
else if(ocmEventDate.competitionId === 10)
{
itemId = 5;
}
// 2nd - Osaka
else if(ocmEventDate.competitionId === 11)
{
itemId = 11;
}
// 3rd - Fukuoka
else if(ocmEventDate.competitionId === 12)
{
itemId = 17;
}
// 4th - Nagoya
else if(ocmEventDate.competitionId === 13)
{
itemId = 23;
}
// 5th - Yaesu
else if(ocmEventDate.competitionId === 14)
{
itemId = 29;
}
// 9th - Hakone (Mt. Taikan)
else if(ocmEventDate.competitionId === 15)
{
itemId = 53;
}
// 10th - Sub-center(Shibuya/Shinjuku)
else if(ocmEventDate.competitionId === 16)
{
itemId = 93;
}
// 11th - Sub-center(Ikebukuro)
else if(ocmEventDate.competitionId === 17)
{
itemId = 99;
}
// 12th - Kobe
else if(ocmEventDate.competitionId === 18)
{
itemId = 105;
}
// 13th - New Belt Line
else if(ocmEventDate.competitionId === 19)
{
itemId = 141;
}
// 14th - Yokohama
else if(ocmEventDate.competitionId === 20)
{
itemId = 147;
}
// 15th - Hiroshima
else if(ocmEventDate.competitionId === 21)
{
itemId = 153;
}
let checkNameplate = await prisma.carItem.count({ let checkNameplate = await prisma.carItem.count({
where:{ where:{

View File

@ -9,7 +9,6 @@ export async function saveGhostHistory(body: wm.protobuf.SaveGameResultRequest)
{ {
console.log('Saving Ghost Battle History'); console.log('Saving Ghost Battle History');
let updateNewTrail: boolean = true;
let saveExGhostHistory: any = {}; let saveExGhostHistory: any = {};
if (body.car?.carId !== null && body.car?.carId !== undefined) { if (body.car?.carId !== null && body.car?.carId !== undefined) {
@ -133,9 +132,6 @@ export async function saveGhostHistory(body: wm.protobuf.SaveGameResultRequest)
await prisma.ghostBattleRecord.create({ await prisma.ghostBattleRecord.create({
data: saveExGhostHistory data: saveExGhostHistory
}); });
// Return the value to 'BASE_PATH/src/util/games/ghost.ts'
return { updateNewTrail }
} }

View File

@ -115,7 +115,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Ghost Battle by Level // Ghost Battle by Level
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_BY_LEVEL: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_BY_LEVEL:
{ {
console.log('Normal Ghost Mode Found'); console.log('Normal Ghost Mode Found - Select by Level');
ghost_historys = await ghost_history.saveGhostHistory(body); ghost_historys = await ghost_history.saveGhostHistory(body);
@ -128,7 +128,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Ghost Battle by Name // Ghost Battle by Name
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_NAME: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_NAME:
{ {
console.log('Normal Ghost Mode Found'); console.log('Normal Ghost Mode Found - Search by Name');
ghost_historys = await ghost_history.saveGhostHistory(body); ghost_historys = await ghost_history.saveGhostHistory(body);
@ -141,7 +141,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Ghost Battle by Region // Ghost Battle by Region
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_REGION: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_REGION:
{ {
console.log('Normal Ghost Mode Found'); console.log('Normal Ghost Mode Found - Search by Region');
ghost_historys = await ghost_history.saveGhostHistory(body); ghost_historys = await ghost_history.saveGhostHistory(body);
@ -154,7 +154,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Ghost Battle from History // Ghost Battle from History
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_FROM_HISTORY: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_FROM_HISTORY:
{ {
console.log('Normal Ghost Mode Found'); console.log('Normal Ghost Mode Found - Select from History');
ghost_historys = await ghost_history.saveGhostHistory(body); ghost_historys = await ghost_history.saveGhostHistory(body);
@ -167,7 +167,7 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Ghost Battle by Shop // Ghost Battle by Shop
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_SHOP: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SEARCH_BY_SHOP:
{ {
console.log('Normal Ghost Mode Found'); console.log('Normal Ghost Mode Found - Search by Shop');
ghost_historys = await ghost_history.saveGhostHistory(body); ghost_historys = await ghost_history.saveGhostHistory(body);
@ -180,10 +180,12 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
// Crown Ghost Battle Mode // Crown Ghost Battle Mode
case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_CROWN_MATCH: case wmproto.wm.protobuf.GhostSelectionMethod.GHOST_SELECT_CROWN_MATCH:
{ {
// If not losing to the crown ghost battle console.log('Crown Ghost Mode Found');
// Not losing to the crown ghost battle
if (body.rgResult?.acquireCrown !== false && body.rgResult?.acquireCrown) if (body.rgResult?.acquireCrown !== false && body.rgResult?.acquireCrown)
{ {
console.log('Crown Ghost Mode Found'); console.log('Win the Crown Ghost Battle');
// Get the ghost crown result // Get the ghost crown result
let ghostResultCrown = body?.rgResult; let ghostResultCrown = body?.rgResult;
@ -316,11 +318,17 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
} }
} }
ghost_historys = await ghost_history.saveGhostHistory(body); updateNewTrail = true;
// Update the updateNewTrail value
updateNewTrail = ghost_historys.updateNewTrail;
} }
// Losing to the crown ghost battle
else
{
console.log('Lose the Crown Ghost Battle');
updateNewTrail = false;
}
await ghost_history.saveGhostHistory(body);
break; break;
} }
@ -333,16 +341,21 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
OCMModePlay = true; OCMModePlay = true;
let saveExOCM: any = {}; let saveExOCM: any = {};
saveExOCM.carId = body.carId; saveExOCM.carId = body.carId;
if(body.rgResult?.competitionId){
if(body.rgResult?.competitionId)
{
saveExOCM.competitionId = body.rgResult?.competitionId!; saveExOCM.competitionId = body.rgResult?.competitionId!;
} }
if(body.rgResult?.periodId){
if(body.rgResult?.periodId)
{
saveExOCM.periodId = body.rgResult?.periodId!; saveExOCM.periodId = body.rgResult?.periodId!;
} }
else else
{ {
saveExOCM.periodId = 0; saveExOCM.periodId = 0;
} }
if(body.rgResult?.brakingPoint) if(body.rgResult?.brakingPoint)
{ {
saveExOCM.brakingPoint = body.rgResult?.brakingPoint!; saveExOCM.brakingPoint = body.rgResult?.brakingPoint!;
@ -351,7 +364,9 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
{ {
saveExOCM.brakingPoint = 0; saveExOCM.brakingPoint = 0;
} }
if(body?.playedAt){
if(body?.playedAt)
{
saveExOCM.playedAt = body?.playedAt!; saveExOCM.playedAt = body?.playedAt!;
} }
@ -364,7 +379,8 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
}); });
// User's OCM Battle data available // User's OCM Battle data available
if(countOCM !== 0){ if(countOCM !== 0)
{
console.log('OCM Play Record found'); console.log('OCM Play Record found');
console.log('Updaing OCM Play Record entry'); console.log('Updaing OCM Play Record entry');
@ -377,7 +393,8 @@ export async function saveGhostBattleResult(body: wm.protobuf.SaveGameResultRequ
}); });
} }
// First time User playing OCM Battle // First time User playing OCM Battle
else{ else
{
console.log('OCM Play Record not found'); console.log('OCM Play Record not found');
console.log('Creating new OCM Play Record entry'); console.log('Creating new OCM Play Record entry');

View File

@ -536,259 +536,24 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}); });
let participantLength = getCarParticipant.length;
if(getCarParticipant) if(getCarParticipant)
{ {
console.log('Giving OCM Rewards'); console.log('Giving OCM Rewards');
// Participant is less than 100 let participantLength = getCarParticipant.length;
if(participantLength < 101)
{
// 16th - C1
if(competitionId === 1)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Fantasy)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 204,
amount: 1
}
})
// Ranking within the top 100 (Unicorn)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 205,
amount: 1
}
})
}
}
// 17th - Osaka
else if(competitionId === 2)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Tread Pattern)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 210,
amount: 1
}
})
// Ranking within the top 100 (Griffon)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 211,
amount: 1
}
})
}
}
// 18th - Fukuoka
else if(competitionId === 3)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (City)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 216,
amount: 1
}
})
// Ranking within the top 100 (Wyvern)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 217,
amount: 1
}
})
}
}
// 19th - Nagoya
else if(competitionId === 4)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Tribal)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 222,
amount: 1
}
})
// Ranking within the top 100 (Gargoyle)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 223,
amount: 1
}
})
}
}
// 6th - C1
else if(competitionId === 5)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Silver Craft)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 35,
amount: 1
}
})
// Ranking within the top 100 (Bear)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 36,
amount: 1
}
})
}
}
// 20th - Kobe
else if(competitionId === 6)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Gemstone)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 228,
amount: 1
}
})
// Ranking within the top 100 (Minotaur)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 229,
amount: 1
}
})
}
}
// 7th - Fukutoshin
else if(competitionId === 7)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Koi)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 41,
amount: 1
}
})
// Ranking within the top 100 (Crocodile)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 42,
amount: 1
}
})
}
}
// 21st - Hiroshima
else if(competitionId === 8)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Ukiyo-e)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 234,
amount: 1
}
})
// Ranking within the top 100 (Cerberus)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 235,
amount: 1
}
})
}
}
// 8th - Hakone
else if(competitionId === 9)
{
for(let i=0; i<participantLength; i++)
{
// Participation Award (Studs)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 47,
amount: 1
}
})
// Ranking within the top 100 (Elephant)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 48,
amount: 1
}
})
}
}
}
// Participant is more than 100 // Participant is more than 100
else if(participantLength > 100)
{ {
participantLength = 100
}
// 16th - C1 // 16th - C1
if(competitionId === 1) if(competitionId === 1)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Fantasy) // Participation Award (Fantasy)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -797,8 +562,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Unicorn) // Ranking within the top 100 (Unicorn GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -808,26 +576,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Fantasy)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 204,
amount: 1
}
})
}
} }
// 17th - Osaka // 17th - Osaka
else if(competitionId === 2) else if(competitionId === 2)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Tread Pattern) // Participation Award (Tread Pattern)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -836,8 +591,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Griffon) // Ranking within the top 100 (Griffon GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -847,26 +605,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Tread Pattern)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 210,
amount: 1
}
})
}
} }
// 18th - Fukuoka // 18th - Fukuoka
else if(competitionId === 3) else if(competitionId === 3)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (City) // Participation Award (City)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -875,8 +620,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Wyvern) // Ranking within the top 100 (Wyvern GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -886,26 +634,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (City)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 216,
amount: 1
}
})
}
} }
// 19th - Nagoya // 19th - Nagoya
else if(competitionId === 4) else if(competitionId === 4)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Tribal) // Participation Award (Tribal)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -914,8 +649,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Gargoyle) // Ranking within the top 100 (Gargoyle GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -925,26 +663,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Tribal)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 222,
amount: 1
}
})
}
} }
// 6th - C1 // 6th - C1
else if(competitionId === 5) else if(competitionId === 5)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Silver Craft) // Participation Award (Silver Craft)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -953,8 +678,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Bear) // Ranking within the top 100 (Bear GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -964,26 +692,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Silver Craft)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 35,
amount: 1
}
})
}
} }
// 20th - Kobe // 20th - Kobe
else if(competitionId === 6) else if(competitionId === 6)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Gemstone) // Participation Award (Gemstone)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -992,8 +707,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Minotaur) // Ranking within the top 100 (Minotaur GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1003,26 +721,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Gemstone)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 228,
amount: 1
}
})
}
} }
// 7th - Fukutoshin // 7th - Fukutoshin
else if(competitionId === 7) else if(competitionId === 7)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Koi) // Participation Award (Koi)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1031,8 +736,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Crocodile) // Ranking within the top 100 (Crocodile GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1042,26 +750,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Koi)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 41,
amount: 1
}
})
}
} }
// 21st - Hiroshima // 21st - Hiroshima
else if(competitionId === 8) else if(competitionId === 8)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Ukiyo-e) // Participation Award (Ukiyo-e)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1070,8 +765,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Cerberus) // Ranking within the top 100 (Cerberus GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1081,26 +779,13 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
for(let i=101; i<participantLength; i++)
{
// Participation Award (Ukiyo-e)
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 234,
amount: 1
}
})
}
} }
// 8th - Hakone // 8th - Hakone
else if(competitionId === 9) else if(competitionId === 9)
{
for(let i=0; i<101; i++)
{ {
// Participation Award (Studs) // Participation Award (Studs)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1109,8 +794,11 @@ export async function ocmGiveNamePlateReward(competitionId: number)
amount: 1 amount: 1
} }
}) })
}
// Ranking within the top 100 (Elephant) // Ranking within the top 100 (Elephant GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
@ -1120,19 +808,353 @@ export async function ocmGiveNamePlateReward(competitionId: number)
} }
}) })
} }
}
for(let i=101; i<participantLength; i++) // 1st - C1
else if(competitionId === 10)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{ {
// Participation Award (Studs)
await prisma.carItem.create({ await prisma.carItem.create({
data:{ data:{
carId: getCarParticipant[i].carId, carId: getCarParticipant[i].carId,
category: 17, category: 17,
itemId: 47, itemId: 5,
amount: 1 amount: 1
} }
}) })
} }
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 6,
amount: 1
}
})
}
}
// 2nd - Osaka
else if(competitionId === 11)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 11,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 12,
amount: 1
}
})
}
}
// 3rd - Fukuoka
else if(competitionId === 12)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 17,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 18,
amount: 1
}
})
}
}
// 4th - Nagoya
else if(competitionId === 13)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 23,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 24,
amount: 1
}
})
}
}
// 5th - Yaesu
else if(competitionId === 14)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 29,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 30,
amount: 1
}
})
}
}
// 9th - Hakone (Mt. Taikan)
else if(competitionId === 15)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 53,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 54,
amount: 1
}
})
}
}
// 10th - Sub-center(Shibuya/Shinjuku)
else if(competitionId === 16)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 93,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 94,
amount: 1
}
})
}
}
// 11th - Sub-center(Ikebukuro)
else if(competitionId === 17)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 99,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 100,
amount: 1
}
})
}
}
// 12th - Kobe
else if(competitionId === 18)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 105,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 106,
amount: 1
}
})
}
}
// 13th - New Belt Line
else if(competitionId === 19)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 141,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 142,
amount: 1
}
})
}
}
// 14th - Yokohama
else if(competitionId === 20)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 147,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 148,
amount: 1
}
})
}
}
// 15th - Hiroshima
else if(competitionId === 21)
{
// Participation Award (// TODO: name this)
for(let i=0; i<getCarParticipant.length; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 153,
amount: 1
}
})
}
// Ranking within the top 100 (// TODO: name this GP)
for(let i=0; i<participantLength; i++)
{
await prisma.carItem.create({
data:{
carId: getCarParticipant[i].carId,
category: 17,
itemId: 154,
amount: 1
}
})
} }
} }

View File

@ -59,7 +59,7 @@ export async function saveStoryResult(body: wm.protobuf.SaveGameResultRequest, c
data.stClearBits = storyResult.stClearBits; data.stClearBits = storyResult.stClearBits;
} }
// Calling give meter reward function (BASE_PATH/src/util/meter_reward.ts) // Calling check step function (BASE_PATH/src/util/games/games_util/check_step.ts)
let check_steps = await check_step.checkCurrentStep(body); let check_steps = await check_step.checkCurrentStep(body);
// Set the ghost level to the correct level // Set the ghost level to the correct level