Merge pull request #29 from aegroto/master
added die-on-spawn while on enemy parcels and added more checks on si…
This commit is contained in:
commit
18343b8fab
@ -26,4 +26,4 @@ config.power = tonumber(minetest.setting_get("power")) or 1
|
||||
config.maxpower = tonumber(minetest.setting_get("maxpower")) or 4
|
||||
config.power_per_banner = minetest.settings:get("power_per_banner") or 1
|
||||
config.attack_parcel = minetest.settings:get_bool("attack_parcel") or false
|
||||
config.siege_banner_interval = minetest.settings:get_bool("siege_banner_interval") or 300
|
||||
config.siege_banner_interval = minetest.settings:get_bool("siege_banner_interval") or 300
|
@ -974,11 +974,26 @@ function(player)
|
||||
alignment = {x=0, y=0},
|
||||
})
|
||||
local faction = factions.get_player_faction(name)
|
||||
|
||||
if faction then
|
||||
faction.last_logon = os.time()
|
||||
createHudFactionName(player,faction.name)
|
||||
createHudPower(player,faction)
|
||||
end
|
||||
|
||||
local pos = player:get_pos()
|
||||
|
||||
local parcel_faction = factions.get_faction_at(pos)
|
||||
|
||||
if parcel_faction then
|
||||
if not faction or parcel_faction.name ~= faction.name then
|
||||
minetest.after(1, function()
|
||||
if player then
|
||||
player:set_hp(0)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
@ -127,6 +127,8 @@ for j = 1, siege_banner_stages - 1 do
|
||||
minetest.set_node(pos, { name = "factions:siege_banner_" .. j + 1 })
|
||||
minetest.get_meta(pos):set_string("infotext", "Siege Banner " .. j + 1 .. "/" .. siege_banner_stages .. " (" .. att_fac_name .. " vs " .. def_fac_name .. ")")
|
||||
|
||||
factions.get_faction(def_fac_name):broadcast("Your parcel at " .. format_pos(pos) .. "is being sieged (" .. j + 1 .. "/" .. siege_banner_stages .. ")")
|
||||
|
||||
meta:set_string("attacking_faction", att_fac_name)
|
||||
meta:set_string("defending_faction", def_fac_name)
|
||||
end
|
||||
@ -150,13 +152,18 @@ minetest.register_abm({
|
||||
|
||||
local parcelpos = factions.get_parcel_pos(pos)
|
||||
|
||||
defending_faction:bulk_unclaim_parcel(parcelpos)
|
||||
defending_faction:decrease_usedpower(factions.power_per_parcel)
|
||||
attacking_faction:bulk_claim_parcel(parcelpos)
|
||||
attacking_faction:increase_usedpower(factions.power_per_parcel)
|
||||
if defending_faction then
|
||||
defending_faction:bulk_unclaim_parcel(parcelpos)
|
||||
|
||||
defending_faction:broadcast(att_fac_name .. " has successfully conquered your parcel at " .. format_pos(pos))
|
||||
end
|
||||
|
||||
if attacking_faction then
|
||||
attacking_faction:bulk_claim_parcel(parcelpos)
|
||||
|
||||
attacking_faction:broadcast("Successfully conquered parcel at " .. format_pos(pos) .. " !")
|
||||
end
|
||||
|
||||
defending_faction:broadcast(att_fac_name .. " has successfully conquered your parcel at " .. format_pos(pos))
|
||||
attacking_faction:broadcast("Successfully conquered parcel at " .. format_pos(pos) .. " !")
|
||||
|
||||
minetest.set_node(pos, { name = "bones:bones" })
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user