ID:144611
 
atom/proc/Bumped()

turf
World1
icon='Worlds.dmi'
icon_state="1"
density=1
var/playerownership=""
var/pname=""
var/race=""
var/ringed=0
var/mooned=0
var/size=20
var/population=0
var/shipyard=0
Bumped(mob/M)
if(M.colanyship)
switch(input("Colonise world?","Colonisation") in list ("yes","no"))
if("yes")
src.population+=10000
src.playerownership=usr.key
if("no")
return null
else
switch(input("Attack World?","Bombard") in list ("yes","no"))
if("yes")
src.population-=1000
sleep(1)
if(population<=0)
src.playerownership=null
if("no")
return null


mob
var
colanyship=1
mob
colanyship
icon='Yship.dmi'
icon_state="YColany"
density=1


I have a problem with bump when i the ship bumps into the planet it i does nothing. I haven't done much on bump for a while so someone tell. Please also look if there are any problems because i'm lacking sleep...
You have to actually call Bumped()

atom/proc/Bumped(atom/movable/bumped_by) //Declare a new proc for all atoms called Bumped.
atom/movable/Bump(atom/O)
if(O) O.Bumped(src) //Then make Bump call Bumped for the atom that was hit.


As for the code you showed, you should make sure the thing Bumped() is actually a mob. You can't just type Bumped(mob/M) and then think everytime it's Bumped() the thing it was Bumped() by was a mob.

        Bumped(atom/A) 
if(ismob(A)) //check if the atom is a mob
var/mob/M = A //now that we're sure it's a mob, we can refer to it as one
if(M.colanyship)
switch(input("Colonise world?","Colonisation") in list ("yes","no"))
if("yes")
src.population+=10000
src.playerownership=usr.key
if("no")
return null


Finally, you don't need to do if("no") and then return null. Doing this gives the same effect:

                switch(input("Colonise world?","Colonisation") in list ("yes","no"))
if("yes")
src.population+=10000
src.playerownership=usr.key
In response to DeathAwaitsU
Thanks superman you save another! :P