📄 armament_action_init_data.php
字号:
<?php
//----------初始化城池表数据(坐标)
$area_x_y_query=$db->query("select area,area_x from city_area where `area`='".$city_area_data[0]."' and `area_x`='".$city_area_data[1]."'");
$area_x_y_result=$db->fetch_array($area_x_y_query);
//$query_city_area=$db->query("insert into city_area(`id`,`area`,`area_x`) values('','".$city_area_data[0]."','".$city_area_data[1]."') ");
$city_area = $city_area_data[0];
$city_area_x = $city_area_data[1];
$query_city_area=$db->query("insert into city_area(`id`,`area`,`area_x`) values('','".$city_area_data[0]."','".$city_area_data[1]."') ");
//玩家城市信息(city)
$city_land_type = rand(1,5);
$city_size = rand(180,280);
$db->query("insert into city(`c_id`,`u_id`,`c_name`,`c_area`,`c_area_x`,`c_area_y`,`total_hills`,`free_hills`,`total_woodlands`,`free_woodlands`,`total_flats`,`free_flats`,`total_barracks`,`free_barracks`,`total_house`,`free_house`,`c_img`,`c_size`,`c_total_size`,`c_land_type`,`c_type`,`create_date`)
values('','".$war_array["u_id"]."','','".$city_area."','".$city_area_x."','0','".$free_hills_init."','".$grow_use_hills."','".$free_woodlands_init."','".$grow_use_woodlands."','".$free_flats_init."','".$grow_use_flats."','".$total_barracks_init."','".$free_barracks_init."',
'".$total_house_init."','".$free_house_init."','1','".$city_size."','".$city_size."', '".$city_land_type."', '0','".time()."') ");
$city_id=$db->insert_id();
//初始化总资源(resource)
//$free_stores=$woods+$ores+$rices+$golds;
$db->query("insert into resource(`r_id`,`u_id`,`c_id`,`woods`,`rices`,`ores`,`golds`,`woods_uplimit`,`rices_uplimit`,`ores_uplimit`,`golds_uplimit`)
values('','".$war_array["u_id"]."','".$city_id."','".$woods."','".$rices."','".$ores."','".$golds."','".$woods_uplimit."' ,'".$rices_uplimit."' ,'".$irons_uplimit."' ,'".$golds_uplimit."')");
//各建筑物的初始值(building)
$db->query("insert into building(`b_id`,`u_id`,`c_id`,`b_iron_ore`,`b_gold_ore`,`b_cutting`,`b_farm`,`b_house`,`b_work_house`,`b_barracks`,`b_horse`,`b_pub`,`b_store`,`b_college`,`b_city_wall`,`b_citywall_fy`,`b_city_upgrade`)
values('','".$war_array["u_id"]."','".$city_id."','".$b_iron_ore."','".$b_gold_ore."','".$b_cutting."','".$b_farm."','".$b_house."','".$b_barracks."','".$b_soldiers."','".$b_horse."','".$b_pub."','".$b_store."','".$b_college."','".$b_city_wall."','".$b_city_fy."','".$b_city_upgrade."')");
//初始生产安排表
for($i=1;$i<=4;$i++){
$db->query("insert into resource_grow(`id`,`u_id`,`c_id`,`b_type`,`last_grow_time`,`worker_percent`,`true_workers`,`total_grow`) values('','".$war_array["u_id"]."','".$city_id."','".$i."','".time()."','100','0','0')");
}
$db->query("INSERT INTO `soldier` ( `s_id` , `u_id` , `c_id` , `bu_zhu` , `tan_zhi` , `zz_bing` , `pd_shou` , `dg_shou` , `be_shi` , `bmy_chong` , `zc_dui` , `xds_shi` , `zz_che` , `xz_ying` , `jwj_bing` , `xlt_qi` , `wdf_jun` , `hb_qi` , `pl_che` , `np_che` )
VALUES ('', '".$war_array["u_id"]."', '".$city_id."', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');");
///////////////////////////////////////////////////////////////
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -