addItem goodType修改

This commit is contained in:
luying
2020-12-18 17:13:49 +08:00
parent f2c124a6e4
commit 623e760005
13 changed files with 187 additions and 242 deletions

View File

@@ -42,21 +42,21 @@ const moment = require('moment');
let result: any;
switch (type) {
case 'fixReward': {
let [gid, count] = arr;
if(isNaN(gid) || isNaN(count)) throw new Error('data table format wrong');
result = { gid: parseInt(gid), count: parseInt(count)};
let [id, count] = arr;
if(isNaN(id) || isNaN(count)) throw new Error('data table format wrong');
result = { id: parseInt(id), count: parseInt(count)};
break;
}
case 'conditionReward': {
let [gid, count, condition] = arr;
if(isNaN(gid) || isNaN(count)) throw new Error('data table format wrong');
result = { gid: parseInt(gid), count: parseInt(count), condition: parseInt(condition) };
let [id, count, condition] = arr;
if(isNaN(id) || isNaN(count)) throw new Error('data table format wrong');
result = { id: parseInt(id), count: parseInt(count), condition: parseInt(condition) };
break;
}
case 'randomReward': {
let [gid, count, frequency] = arr;
if(isNaN(gid) || isNaN(count)) throw new Error('data table format wrong');
result = { gid: parseInt(gid), count: parseInt(count), frequency: parseInt(frequency) };
let [id, count, frequency] = arr;
if(isNaN(id) || isNaN(count)) throw new Error('data table format wrong');
result = { id: parseInt(id), count: parseInt(count), frequency: parseInt(frequency) };
break;
}
case 'suitLevel': {
@@ -91,9 +91,9 @@ const moment = require('moment');
break;
}
case 'decimalReward': {
let [gid, count] = arr;
if(isNaN(gid) || isNaN(count)) throw new Error('data table format wrong');
result = { gid: parseInt(gid), count: parseFloat(count) };
let [id, count] = arr;
if(isNaN(id) || isNaN(count)) throw new Error('data table format wrong');
result = { id: parseInt(id), count: parseFloat(count) };
break;
}
case 'towerTaskCondition': {